Removed useless code

This commit is contained in:
Marc Stern
2024-07-22 16:53:58 +02:00
parent 28b6e1d7d0
commit cd65a44d64
8 changed files with 63 additions and 105 deletions

View File

@@ -2473,28 +2473,16 @@ not_enough_memory:
int read_line(char *buf, int len, FILE *fp)
{
char *tmp;
if (buf == NULL) return -1;
if (buf == NULL)
{
return -1;
}
memset(buf, '\0', len*sizeof(char));
if (fgets(buf, len, fp) == NULL)
{
if (fgets(buf, len, fp) == NULL) {
*buf = '\0';
return 0;
}
else
{
if ((tmp = strrchr(buf, '\n')) != NULL)
{
*tmp = '\0';
}
}
char* tmp;
if ((tmp = strrchr(buf, '\n')) != NULL) *tmp = '\0';
return 1;
}