OSDN Git Service
(root)
/
ccunit
/
ccunit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b6bba8
)
fix buffer under run.
author
tsntsumi
<tsntsumi@users.sourceforge.jp>
Sat, 14 Aug 2010 15:23:53 +0000
(15:23 +0000)
committer
tsntsumi
<tsntsumi@users.sourceforge.jp>
Sat, 14 Aug 2010 15:23:53 +0000
(15:23 +0000)
src/ccunit/CCUnitReadSuite.c
patch
|
blob
|
history
diff --git
a/src/ccunit/CCUnitReadSuite.c
b/src/ccunit/CCUnitReadSuite.c
index
4d5d761
..
bc85b1c
100644
(file)
--- a/
src/ccunit/CCUnitReadSuite.c
+++ b/
src/ccunit/CCUnitReadSuite.c
@@
-318,11
+318,23
@@
static int readline ()
if (!sp)
return 0;
/* chomp CR/LF */
- tail = line.str + line.length - 1;
- while (*tail == '\n' || *tail == '\r') /* for dos/mac? */
+ if (line.length > 0)
{
- line.length --;
- *(tail --) = '\0';
+ tail = line.str + line.length - 1;
+ if (*tail == '\n')
+ {
+ line.length --;
+ *tail = '\0';
+ if (line.length > 0)
+ tail --;
+ }
+ if (*tail == '\r') /* for dos and/or mac? */
+ {
+ line.length --;
+ *tail = '\0';
+ if (line.length > 0)
+ tail --;
+ }
}
line.lno ++;
return 1;