From: cuz Date: Tue, 2 Mar 2004 19:25:26 +0000 (+0000) Subject: Pass chars as ints X-Git-Tag: V2.12.0~931 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bf337a37bc8f254a515e5173305d11870b389eb;p=cc65 Pass chars as ints git-svn-id: svn://svn.cc65.org/cc65/trunk@2890 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/common/strbuf.c b/src/common/strbuf.c index 39a325990..0adf5a5c3 100644 --- a/src/common/strbuf.c +++ b/src/common/strbuf.c @@ -195,14 +195,14 @@ void SB_Copy (StrBuf* Target, const StrBuf* Source) -void SB_AppendChar (StrBuf* B, char C) +void SB_AppendChar (StrBuf* B, int C) /* Append a character to a string buffer */ { unsigned NewLen = B->Len + 1; if (NewLen > B->Allocated) { SB_Realloc (B, NewLen); } - B->Buf[B->Len] = C; + B->Buf[B->Len] = (char) C; B->Len = NewLen; } @@ -286,7 +286,7 @@ void SB_Slice (StrBuf* Target, const StrBuf* Source, unsigned Start, unsigned Le void SB_Move (StrBuf* Target, StrBuf* Source) /* Move the complete contents of Source to target. This will delete the old * contents of Target, and Source will be empty after the call. - */ + */ { /* Free the target string */ if (Target->Buf) { diff --git a/src/common/strbuf.h b/src/common/strbuf.h index cd58932c6..a209f4e9e 100644 --- a/src/common/strbuf.h +++ b/src/common/strbuf.h @@ -286,7 +286,7 @@ void SB_Copy (StrBuf* Target, const StrBuf* Source); /* Copy Source to Target, discarding the old contents of Target */ #endif -void SB_AppendChar (StrBuf* B, char C); +void SB_AppendChar (StrBuf* B, int C); /* Append a character to a string buffer */ void SB_AppendBuf (StrBuf* B, const char* S, unsigned Size);