From 838f275264a7563774d64641eafc54beef53519a Mon Sep 17 00:00:00 2001 From: John Cage <58808125+coshcage@users.noreply.github.com> Date: Sun, 5 May 2024 09:32:15 +0000 Subject: [PATCH] Add files via upload --- src/sixmem.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sixmem.c b/src/sixmem.c index 27f4e03..99fdb4a 100644 --- a/src/sixmem.c +++ b/src/sixmem.c @@ -2,7 +2,7 @@ * Name: sixmem.c * Description: SI external memory function. * Author: cosh.cage#hotmail.com - * File ID: 0714231200H0505240225L00383 + * File ID: 0714231200H0505240225L00389 * License: GPLv2. */ #include "sixmem.h" @@ -32,7 +32,13 @@ */ void _siReadString(char * buf, FILE * fp) { - fgets(buf, BUFSIZ - 1, fp); + size_t i = 0; + while ((i < BUFSIZ - 1) && (*buf = fgetc(fp))) + { + ++buf; + ++i; + } + buf[i] = '\0'; } /* Attention: This Is An Internal Function. No Interface for Library Users.