Author: tkreuzer
Date: Sun Dec 27 20:24:04 2015
New Revision: 70450

URL: http://svn.reactos.org/svn/reactos?rev=70450&view=rev
Log:
[CRT]
Fix a typo in a comment and make it clearer, what we do here.
CORE-10754 #resolve

Modified:
    trunk/reactos/lib/sdk/crt/string/i386/tcslen.inc

Modified: trunk/reactos/lib/sdk/crt/string/i386/tcslen.inc
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/i386/tcslen.inc?rev=70450&r1=70449&r2=70450&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/i386/tcslen.inc    [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/i386/tcslen.inc    [iso-8859-1] Sun Dec 27 
20:24:04 2015
@@ -29,9 +29,11 @@
     /* Now compare the characters until a 0 is found */
     repne _tscas
 
-    /* Calculate the count (eax = -ecx - 1) */
+    /* Calculate the count. For n characters, we do (n + 1) comparisons. 
Initial
+       value of ecx was -1, so end value of ecx is (-1 - (n + 1)) = -(n + 2).
+       => n = -ecx - 2 = ~ecx - 1 */
     not ecx
-    lea eax, [ecx-1]
+    lea eax, [ecx - 1]
 
     /* Restore eflags/edi and return the result */
     popfd


Reply via email to