diff options
author | Christoph Lohmann <20h@r-36.net> | 2013-02-26 19:07:23 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2013-02-26 19:07:23 +0100 |
commit | 1aa26b4ecd68e6071d36e9103aa9c21711bbf6ea (patch) | |
tree | 3e615ec4717ad092a90c150b46004cf72243ab9d | |
parent | 7d32471efffa825f52d24930b5ee617105f9c83e (diff) | |
download | st-patched-1aa26b4ecd68e6071d36e9103aa9c21711bbf6ea.tar.bz2 st-patched-1aa26b4ecd68e6071d36e9103aa9c21711bbf6ea.tar.xz st-patched-1aa26b4ecd68e6071d36e9103aa9c21711bbf6ea.zip |
Fixing a bug while parsing empty arguments in csiparse.
-rw-r--r-- | st.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1295,7 +1295,6 @@ tnewline(int first_col) { | |||
1295 | 1295 | ||
1296 | void | 1296 | void |
1297 | csiparse(void) { | 1297 | csiparse(void) { |
1298 | /* int noarg = 1; */ | ||
1299 | char *p = csiescseq.buf, *np; | 1298 | char *p = csiescseq.buf, *np; |
1300 | long int v; | 1299 | long int v; |
1301 | 1300 | ||
@@ -1306,9 +1305,10 @@ csiparse(void) { | |||
1306 | } | 1305 | } |
1307 | 1306 | ||
1308 | while(p < csiescseq.buf+csiescseq.len) { | 1307 | while(p < csiescseq.buf+csiescseq.len) { |
1308 | np = NULL; | ||
1309 | v = strtol(p, &np, 10); | 1309 | v = strtol(p, &np, 10); |
1310 | if(np == p) | 1310 | if(np == p) |
1311 | break; | 1311 | v = 0; |
1312 | if(v == LONG_MAX || v == LONG_MIN) | 1312 | if(v == LONG_MAX || v == LONG_MIN) |
1313 | v = -1; | 1313 | v = -1; |
1314 | csiescseq.arg[csiescseq.narg++] = v; | 1314 | csiescseq.arg[csiescseq.narg++] = v; |