[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (573f93618ccffbc3084115db7e0d40c46f2b42fa)



The branch, master has been updated
       via  573f93618ccffbc3084115db7e0d40c46f2b42fa (commit)
      from  f25ffbd309dd692389f1d517c8642cc9b66a406c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


=================
 Commit Messages
=================

commit 573f93618ccffbc3084115db7e0d40c46f2b42fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    file.c: Don't walk off the end of a string in string_cmp()
    
    We need to check that we don't advance past the terminating \0
    in the string.

:100644 100644 db167c8... dce31a8... M	src/file.c

=========
 Changes
=========

commit 573f93618ccffbc3084115db7e0d40c46f2b42fa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    file.c: Don't walk off the end of a string in string_cmp()
    
    We need to check that we don't advance past the terminating \0
    in the string.

diff --git a/src/file.c b/src/file.c
index db167c8..dce31a8 100644
--- a/src/file.c
+++ b/src/file.c
@@ -144,9 +144,9 @@ string_cmp (const char *a, const char *b)
 	  int ib = atoi (b);
 	  if (ia != ib)
 	    return ia - ib;
-	  while (isdigit ((int) *a))
+	  while (isdigit ((int) *a) && *(a+1))
 	    a++;
-	  while (isdigit ((int) *b))
+	  while (isdigit ((int) *b) && *(b+1))
 	    b++;
 	}
       else if (tolower ((int) *a) != tolower ((int) *b))




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs