I did come across that link, but the site clearly doesn't check it's work once posted. I found a bunch of problems with this code. For example, the following function:
// Calculating the Check...
Type: Posts; User: Yonut
I did come across that link, but the site clearly doesn't check it's work once posted. I found a bunch of problems with this code. For example, the following function:
// Calculating the Check...
I just noticed something strange. I ran the program, and while it was hanging and not responding, I opened a terminal and ran `ping 8.8.8.8`. While ping ran, my program actually returned...
Sorry, I don't get those errors, but it's because of my gcc compile options. I'm compiling with:
gcc -Wall -Werror -Wextra -Wfatal-errors -D_GNU_SOURCE -O3 -o ./pinger pinger.c
Hi,
I'm trying to create a simple ping routine, that can be used in other programs to test internet connectivity. I'm stuck, as the following code seems to send the request, but `recvfrom` blocks...
OK, but I still don't understand what you mean by "safe". All characters that you might find in a file name are "safe" (otherwise the OS wouldn't have let you use them in a file name in the first...
Why does it have to be the same process? Can't one fix the names and another display them.
And I'm using `stat` before `rename` with the new filename, to make sure it isn't replacing an existing...
Don't remember asking people to do something for me. In fact, the OP was about how `strspn` has trouble handling the pound symbol `#`.
And for the 'management' portion of your code, what happens...
If the questions are from you wanting me to 'consider this', then maybe you should answer them.
As for non-displayed ASCII characters, how many files have you downloaded or created that have...
This is what I test to see if I need to change the filename:
if(strlen(filename) != strcspn(filename, SPECIAL_CHARS))
And this is what I use while changing the filename.
for(size_t x = 0; x...
Actually, following the course of the conversation, you would notice that I changed my use of `strspn` to `strcsnp`, which does the following:
1) If there are no special characters, it returns the...
Your right. My local copy of `man strcspn` does not list what errors, or what happens if it is not found. I read somewhere that `strspn` returns 0 when not found. But, I wrongly assumed that 0 in...
Ok, `strcspn` doesn't work. `strcspn` does the exact opposite of my first problem. Yes, it solves the problem of the location with `there#`, but not `#here`. And `strchr` won't work without extra...
Ty, I will look into these.
Ok, this must be related to `strspn`:
#include <stdio.h>
#include <string.h>
int main (int argc, char *argv[])
{
printf("Location: %lu\n", strspn(argv[1], "#"));
for(size_t x = 0;...
Sorry, must have cut the function name instead of copying it.
#include <stdio.h>
#include <string.h>
int main (int argc, char *argv[])
{
printf("Location: %lu\n", strspn(argv[1], "#"));...
I have noticed a problem that I can't explain.
When using `strspn`, it won't recognize the pound symbol unless it's the first character in the string.
Create 2 files:
touch "#here" "there#"...
I wrote my "entertainment system" in C as a way to relax. It has been morphing over the past 12 years. My "entertainment system" can offer me TV Shows, Movies, Games, Images and Music. In all...
Real world example:
I have two boxes. One box contains nothing, we'll say it's equal to 0. The other box contains and apple, we'll say it's equal to 1.
Now if we do the 'infinite series' to...
What you just said contains the problem. The sequence 1/2 + 1/4 + 1/8 + 1/16 + ... never equals one. No matter how far into "infinity" you go. That theory suggests that the moment you stop the...
This is better than what I was going to resort to, thank you.
I have a problem with this video. They talk about the fundamental flaw in 'Maths', but he is talking with infinities. I don't know...
Yes and yes. 0 for completed download. 1 for download incomplete for a myriad of reasons (bad link, interrupted download, no internet connection...). Basically, if it's 0, remove the window.
It...
I am determining success from the return code of `yt-dlp`. Or at least, I'd like to.
I understand where you're coming from. I have seen the types of questions you occasionally get here. But I...
Hi,
I'm trying to create a program that will grab the contents of the clipboard (youtube video link), and download the video. DONE.
Problem encounter is that I need to know if a video was...
Might this have been created by AI?
Sorry, I just noticed this. The reason why I use `basename` on the program name (or argv[0]) is because argv[0] depends on where and how the program is called.
ie:
$ run_my_program (in $PATH) ...