But strncpy doesn't append a \0 to where you copy it from.
Like I said, so long as you don't have contiguous numbers (there is some kind of space, tab, comma, alpha separator), then you can just do...
Type: Posts; User: Salem
But strncpy doesn't append a \0 to where you copy it from.
Like I said, so long as you don't have contiguous numbers (there is some kind of space, tab, comma, alpha separator), then you can just do...
If you showed us what buffer contains, then we might be able to suggest a better way.
Unless you have say "123456" and you expect to get 123 and 456 as separate numbers, you seem to be doing a lot...
If it's just a space separated list of numbers, then use this
man page strtod section 3
Note the last parameter, you use this to "walk" along the string.