Commit ee464195 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Don\'t use strndup.

Rev: src/sftp/ChangeLog:1.35
Rev: src/sftp/str_utils.c:1.4
parent 8758c8a8
2002-06-27 Pontus Skld <Pontus.Skold@dis.uu.se>
* str_utils.c (lsftp_s_strtok): Don't use strndup.
2002-06-27 Pontus Skld <pont@soua.net>
* commands.h: Include gnu_stuff.h to get declaration for
......
......@@ -162,12 +162,12 @@ lsftp_s_strtok(const char* s, const char* sep,
tend = lsftp_s_skipn( s, sep ); /* Find the first separator in our new s (or it's end) */
scopy = strndup(s, tend-s); /* Put the token in store */
scopy = strdup(s ); /* Put the token in store */
if( !scopy )
return NULL;
scopy[tend-s] = 0; /* Make sure it is null-terminated */
scopy[tend-s] = 0; /* Make sure it is null-terminated at the right place */
*store = scopy;
return tend; /* Return a pointer to where we haven't yet looked */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment