Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strutils.strnlen returns actulal length + 1 #643

Closed
lzsiga opened this issue May 27, 2018 · 1 comment
Closed

strutils.strnlen returns actulal length + 1 #643

lzsiga opened this issue May 27, 2018 · 1 comment

Comments

@lzsiga
Copy link

lzsiga commented May 27, 2018

Hi, I'd like to suggest the following fix:

--- strutils.bak.c      2017-02-22 11:16:55.000000000 +0100
+++ strutils.c  2018-05-27 20:38:25.000000000 +0200
@@ -241,7 +241,7 @@
  
          for (i = 0; i < maxlen; i++) {
                  if (s[i] == '\0')
-                         return i + 1;
+                         return i;
          }
          return maxlen;
  }
karelzak added a commit that referenced this issue May 28, 2018
Addresses: #643
Signed-off-by: Karel Zak <kzak@redhat.com>
@karelzak
Copy link
Collaborator

Oh, bug from year 2009... Thanks!

karelzak added a commit that referenced this issue Jul 12, 2018
Addresses: #643
Signed-off-by: Karel Zak <kzak@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants