Browse code

fix missing assignment in sep_select

Dario Rodriguez authored on 21/03/2019 21:36:42
Showing 1 changed files
... ...
@@ -1662,8 +1662,11 @@ sep_select(char *buf, int bufsize, char **pos)
1662 1662
         if(pos!=NULL)
1663 1663
                 *pos=NULL;
1664 1664
         for(i=0,besti=0;i<sizeof(seps);i++) {
1665
-                if((ptr=memchr(buf,seps[i],bufsize))==NULL)
1665
+                if((ptr=memchr(buf,seps[i],bufsize))==NULL) {
1666
+                        if(pos!=NULL)
1667
+                                *pos=buf+bufsize;
1666 1668
                         return(seps[i]);
1669
+                }
1667 1670
                 if(ptr>bestptr) {
1668 1671
                         besti=0;
1669 1672
                         bestptr=ptr;