diff --git a/libtcc.c b/libtcc.c index db30223..6aa2afd 100644 --- a/libtcc.c +++ b/libtcc.c @@ -132,7 +132,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) /********************************************************/ /* copy a string and truncate it. */ -ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s) +ST_FUNC char *pstrcpy(char *buf, size_t buf_size, const char *s) { char *q, *q_end; int c; @@ -152,9 +152,9 @@ ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s) } /* strcat and truncate. */ -ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s) +ST_FUNC char *pstrcat(char *buf, size_t buf_size, const char *s) { - int len; + size_t len; len = strlen(buf); if (len < buf_size) pstrcpy(buf + len, buf_size - len, s); diff --git a/tcc.h b/tcc.h index 6c70f33..59061bc 100644 --- a/tcc.h +++ b/tcc.h @@ -1120,8 +1120,8 @@ ST_DATA int tcc_ext; ST_DATA struct TCCState *tcc_state; /* public functions currently used by the tcc main function */ -ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s); -ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s); +ST_FUNC char *pstrcpy(char *buf, size_t buf_size, const char *s); +ST_FUNC char *pstrcat(char *buf, size_t buf_size, const char *s); ST_FUNC char *pstrncpy(char *out, const char *in, size_t num); PUB_FUNC char *tcc_basename(const char *name); PUB_FUNC char *tcc_fileextension (const char *name);