… | |
… | |
62 | return TRUE; |
62 | return TRUE; |
63 | } |
63 | } |
64 | #endif |
64 | #endif |
65 | #endif |
65 | #endif |
66 | |
66 | |
67 | char * fptools_id = "$Id: fptools.c,v 1.17 2020/12/12 03:54:59 root Exp $"; |
67 | char * fptools_id = "$Id: fptools.c,v 1.18 2020/12/13 03:08:48 root Exp $"; |
68 | |
68 | |
69 | /* |
69 | /* |
70 | * some versions of free can't handle a NULL pointer properly |
70 | * some versions of free can't handle a NULL pointer properly |
71 | * (ANSI says, free ignores a NULL pointer, but some machines |
71 | * (ANSI says, free ignores a NULL pointer, but some machines |
72 | * prefer to SIGSEGV on it) |
72 | * prefer to SIGSEGV on it) |
… | |
… | |
440 | * My own fgets function. It handles all kinds of line terminators |
440 | * My own fgets function. It handles all kinds of line terminators |
441 | * properly: LF (Unix), CRLF (DOS) and CR (Mac). |
441 | * properly: LF (Unix), CRLF (DOS) and CR (Mac). |
442 | */ |
442 | */ |
443 | /* (schmorp) the buffer is always written to, and no LF is stored at the end */ |
443 | /* (schmorp) the buffer is always written to, and no LF is stored at the end */ |
444 | /* also, if the buffer is too short, the remaining line is skipped */ |
444 | /* also, if the buffer is too short, the remaining line is skipped */ |
445 | char * TOOLEXPORT |
445 | ecb_hot char * TOOLEXPORT |
446 | FP_fgets (char *buf, int n, FILE *stream) |
446 | FP_fgets (char *buf, int n, FILE *stream) |
447 | { |
447 | { |
448 | char *ptr = buf; |
448 | char *ptr = buf; |
449 | char *end = buf + n - 1; |
449 | char *end = buf + n - 1; |
450 | |
450 | |