Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
coshcage authored Apr 22, 2024
1 parent 2a22721 commit 52c2945
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sixmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Name: sixmem.c
* Description: SI external memory function.
* Author: cosh.cage#hotmail.com
* File ID: 0714231200H0418240130L00394
* File ID: 0714231200H0422240734L00395
* License: GPLv2.
*/
#include "sixmem.h"
Expand Down Expand Up @@ -53,12 +53,12 @@ void _siReadString(char * buf, FILE * fp)
void _siReadWString(wchar_t * buf, FILE * fp)
{
size_t i = 0;
while ((i < BUFSIZ - 1) && (*buf = fgetwc(fp)))
while ((i < BUFSIZ - 1) && (L'\0' != (*buf = fgetwc(fp))))
{
++buf;
++i;
}
buf[i] = '\0';
buf[i] = L'\0';
}

/* Attention: This Is An Internal Function. No Interface for Library Users.
Expand All @@ -78,7 +78,7 @@ void _siWriteString(char * str, FILE * fp)
++str;
}
/* Put 0. */
fputc(*str, fp);
fputc('\0', fp);
}

/* Attention: This Is An Internal Function. No Interface for Library Users.
Expand All @@ -98,7 +98,7 @@ void _siWriteWString(wchar_t * str, FILE * fp)
++str;
}
/* Put 0. */
fputwc(*str, fp);
fputwc(L'\0', fp);
}

/* Function name: siSaveTable
Expand Down Expand Up @@ -264,6 +264,7 @@ P_TABLE siLoadTable(FILE * fp, long lpos)
{
fread(&((P_TBLHDR)strLocateItemArrayZ(&ptbl->header, sizeof(TBLHDR), i))->ct, sizeof(size_t), 1, fp);
fread(&((P_TBLHDR)strLocateItemArrayZ(&ptbl->header, sizeof(TBLHDR), i))->cr, sizeof(size_t), 1, fp);
((P_TBLHDR)strLocateItemArrayZ(&ptbl->header, sizeof(TBLHDR), i))->phsh = NULL;
}

/* Read column names. */
Expand Down

0 comments on commit 52c2945

Please sign in to comment.