OK well this probably doesn't surprise most of you, but I appended a null character at the end of the string after using strncpy, and now everything works as expected.
I just want to say that I...
Type: Posts; User: marshaul
OK well this probably doesn't surprise most of you, but I appended a null character at the end of the string after using strncpy, and now everything works as expected.
I just want to say that I...
The thing is, the one time I'm actually using the "n" functionality is with the first strncpy, which only copies up to the beginning of the basename.
All the strncats can be replaced with strcat,...
Edit: next page...
Got it...
So does strcat, I take it, append the null character at the end, when strncat does not?
Thanks.
Should I do that manually? If so, should I do so before both the mkdir and the rename commands, both of which use dest (with different values) as arguments?
Thanks for the tip, I will probably...
Well, adding the +1 to the other dest didn't help, nor did changing the +1s to +2. :P
The final strncat does begin with a /, as my "baseName" starts with the final slash in the given path (unlike...
Here is a sample output (stdout) of the current build (with the first of two printf statements in that if-statement commented out):
/tmp/test
/tmp/test&
/tmp/test&
/tmp/test&
/tmp/test&...
Here is the rest of the code in case anybody wants to compile it to see what I'm talking about:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <glob.h>
#include...
I hope this isn't the wrong forum! I'm aware that I'm using some non-ANSI-C functions, but my problem seems to be with simple C strings and pointers, so I'm posting it here.
I wrote a simple...