diff options
author | Qball Cow <qball@gmpclient.org> | 2015-11-12 14:15:33 +0100 |
---|---|---|
committer | Qball Cow <qball@gmpclient.org> | 2015-11-12 14:15:33 +0100 |
commit | c7dcb4821a91c4c41f8ff9a80cc2d7be177a2f87 (patch) | |
tree | 069cd017a42e98ef582f5a3456d5bc19ad3a45a5 /source/helper.c | |
parent | 880f8731becea27a9bcf662258d66e09c3c719ec (diff) |
Use getdelim instead of custom fgets function.
Diffstat (limited to 'source/helper.c')
-rw-r--r-- | source/helper.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/source/helper.c b/source/helper.c index 7157799f..0d0070cc 100644 --- a/source/helper.c +++ b/source/helper.c @@ -56,32 +56,6 @@ void cmd_set_arguments ( int argc, char **argv ) } /** - * `fgets` implementation with custom separator. - */ -char* fgets_s ( char* s, unsigned int n, FILE *iop, char sep ) -{ - // Map these to registers. - register int c = EOF; - register char* cs; - cs = s; - // read until EOF or buffer is full. - while ( --n > 0 && ( c = getc ( iop ) ) != EOF ) { - // put the input char into the current pointer position, then increment it - // if a newline entered, break - if ( ( *cs++ = c ) == sep ) { - // Whipe separator - cs[-1] = '\0'; - break; - } - } - // Always, 0 terminate the buffer. - *cs = '\0'; - // if last read was end of file and current index is start, we are done: - // Return NULL. - return ( c == EOF && cs == s ) ? NULL : cs; -} - -/** * @param info To Match information on. * @param res The string being generated. * @param data User data |