utils: removed myFgets()

Replaced myFgets() with fgets() + g_strchomp().
This commit is contained in:
Max Kellermann
2008-12-28 19:54:49 +01:00
parent 2598cdd868
commit 859aac7242
10 changed files with 38 additions and 32 deletions

View File

@@ -33,18 +33,6 @@
#include <sys/socket.h>
#endif
char *myFgets(char *buffer, int bufferSize, FILE * fp)
{
char *ret = fgets(buffer, bufferSize, fp);
if (ret && strlen(buffer) > 0 && buffer[strlen(buffer) - 1] == '\n') {
buffer[strlen(buffer) - 1] = '\0';
}
if (ret && strlen(buffer) > 0 && buffer[strlen(buffer) - 1] == '\r') {
buffer[strlen(buffer) - 1] = '\0';
}
return ret;
}
void stripReturnChar(char *string)
{
while (string && (string = strchr(string, '\n'))) {