[uim-commit] r2277 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 29 16:37:05 PST 2005
Author: yamaken
Date: 2005-11-29 16:36:56 -0800 (Tue, 29 Nov 2005)
New Revision: 2277
Modified:
branches/r5rs/sigscheme/basecport.c
branches/r5rs/sigscheme/mbcport.c
branches/r5rs/sigscheme/strport.c
Log:
* sigscheme/mbcport.c
- (mbcport_fill_rbuf): Fix null character reading
* sigscheme/strport.c
- (ScmOutputStrPort_str): Return "" instead of NULL
* sigscheme/basecport.c
- Include lacking stdio.h and string.h
Modified: branches/r5rs/sigscheme/basecport.c
===================================================================
--- branches/r5rs/sigscheme/basecport.c 2005-11-29 17:15:42 UTC (rev 2276)
+++ branches/r5rs/sigscheme/basecport.c 2005-11-30 00:36:56 UTC (rev 2277)
@@ -42,7 +42,9 @@
System Include
=======================================*/
#include <stdlib.h>
+#include <stdio.h>
#include <stdarg.h>
+#include <string.h>
/*=======================================
Local Include
Modified: branches/r5rs/sigscheme/mbcport.c
===================================================================
--- branches/r5rs/sigscheme/mbcport.c 2005-11-29 17:15:42 UTC (rev 2276)
+++ branches/r5rs/sigscheme/mbcport.c 2005-11-30 00:36:56 UTC (rev 2277)
@@ -249,7 +249,7 @@
SCM_MBS_SET_STATE(mbs, port->state);
do {
SCM_MBS_SET_STR(mbs, port->rbuf);
- SCM_MBS_SET_SIZE(mbs, strlen(port->rbuf));
+ SCM_MBS_SET_SIZE(mbs, end - port->rbuf);
mbc = SCM_CHARCODEC_SCAN_CHAR(port->codec, mbs);
Modified: branches/r5rs/sigscheme/strport.c
===================================================================
--- branches/r5rs/sigscheme/strport.c 2005-11-29 17:15:42 UTC (rev 2276)
+++ branches/r5rs/sigscheme/strport.c 2005-11-30 00:36:56 UTC (rev 2277)
@@ -301,7 +301,6 @@
return (ScmBytePort *)port;
}
-/* may return NULL */
const char *
ScmOutputStrPort_str(ScmBytePort *bport)
{
@@ -309,7 +308,7 @@
port = SCM_BYTEPORT_DYNAMIC_CAST(ScmOutputStrPort, bport);
- return port->str;
+ return (port->str) ? port->str : "";
}
void **
More information about the uim-commit
mailing list