[ros-diffs] [jmorlan] 39945: Fix bug where wcscspn could return non-zero value on an empty string.

jmorlan at svn.reactos.org jmorlan at svn.reactos.org
Wed Mar 11 04:35:30 CET 2009


Author: jmorlan
Date: Wed Mar 11 06:35:29 2009
New Revision: 39945

URL: http://svn.reactos.org/svn/reactos?rev=39945&view=rev
Log:
Fix bug where wcscspn could return non-zero value on an empty string.

Modified:
    trunk/reactos/lib/sdk/crt/wstring/wcscspn.c

Modified: trunk/reactos/lib/sdk/crt/wstring/wcscspn.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/wstring/wcscspn.c?rev=39945&r1=39944&r2=39945&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] Wed Mar 11 06:35:29 2009
@@ -18,7 +18,7 @@
 	wchar_t *s;
 	wchar_t *t;
 	s=(wchar_t *)str;
-	do {
+	while (*s) {
 		t=(wchar_t *)reject;
 		while (*t) {
 			if (*t==*s)
@@ -28,6 +28,6 @@
 		if (*t)
 			break;
 		s++;
-	} while (*s);
+	}
 	return s-str; /* nr of wchars */
 }



More information about the Ros-diffs mailing list