[hackers] [st] Fixing a bug while parsing empty arguments in csiparse. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Tue, 26 Feb 2013 19:09:47 +0100

commit 1aa26b4ecd68e6071d36e9103aa9c21711bbf6ea
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Tue Feb 26 19:07:23 2013 +0100

    Fixing a bug while parsing empty arguments in csiparse.

diff --git a/st.c b/st.c
index 9f5793c..83fdc6d 100644
--- a/st.c
+++ b/st.c
_AT_@ -1295,7 +1295,6 @@ tnewline(int first_col) {
 
 void
 csiparse(void) {
- /* int noarg = 1; */
         char *p = csiescseq.buf, *np;
         long int v;
 
_AT_@ -1306,9 +1305,10 @@ csiparse(void) {
         }
 
         while(p < csiescseq.buf+csiescseq.len) {
+ np = NULL;
                 v = strtol(p, &np, 10);
                 if(np == p)
- break;
+ v = 0;
                 if(v == LONG_MAX || v == LONG_MIN)
                         v = -1;
                 csiescseq.arg[csiescseq.narg++] = v;
Received on Tue Feb 26 2013 - 19:09:47 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 26 2013 - 19:12:11 CET