[CRT]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 27 Dec 2015 20:24:04 +0000 (20:24 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 27 Dec 2015 20:24:04 +0000 (20:24 +0000)
Fix a typo in a comment and make it clearer, what we do here.
CORE-10754 #resolve

svn path=/trunk/; revision=70450

reactos/lib/sdk/crt/string/i386/tcslen.inc

index 1f3842f..479a719 100644 (file)
@@ -29,9 +29,11 @@ FUNC _tcslen
     /* Now compare the characters until a 0 is found */\r
     repne _tscas\r
 \r
-    /* Calculate the count (eax = -ecx - 1) */\r
+    /* Calculate the count. For n characters, we do (n + 1) comparisons. Initial\r
+       value of ecx was -1, so end value of ecx is (-1 - (n + 1)) = -(n + 2).\r
+       => n = -ecx - 2 = ~ecx - 1 */\r
     not ecx\r
-    lea eax, [ecx-1]\r
+    lea eax, [ecx - 1]\r
 \r
     /* Restore eflags/edi and return the result */\r
     popfd\r