Skip to content

Commit

Permalink
Fixed sprintf not including a null terminator in libc
Browse files Browse the repository at this point in the history
Fixed Bfile_NameToStr argument names
  • Loading branch information
tswilliamson committed Feb 1, 2020
1 parent 1e4e0f8 commit c81d88a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/fxcg/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int Bfile_ReadFile_OS( int HANDLE, void *buf, int size, int readpos );
int Bfile_SeekFile_OS( int handle, int pos );
int Bfile_TellFile_OS( int handle );
int Bfile_WriteFile_OS( int HANDLE, const void *buf, int size );
void Bfile_NameToStr_ncpy(char*source, const unsigned short*dest, size_t n);
void Bfile_NameToStr_ncpy(char*dest, const unsigned short*source, size_t n);
void Bfile_StrToName_ncpy(unsigned short *dest, const char *source, size_t n);
int Bfile_Name_MatchMask( const short*mask, const short*filename );
int Bfile_GetMediaFree_OS( unsigned short*media_id, int*freespace );
Expand Down
Binary file modified lib/libc.a
Binary file not shown.
4 changes: 4 additions & 0 deletions libc/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ static int _v_printf(const char *fmt, va_list ap_in, writer_t writer, const void
}
out:
va_end(ap);

// null terminator
writer(warg, 0);

return count;
}

Expand Down

0 comments on commit c81d88a

Please sign in to comment.