commit 34189e0a1f288e05ce528bcab28b922d53d5e471
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Mon Jul 2 18:41:29 2018 +0200
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Mon Jul 2 18:41:29 2018 +0200

    Use sizeof() - 1 rather than strlen()
    
    I know, most compiler probably optimize this anyway, but why not do it
    right in the first place?

diff --git a/util.c b/util.c
index 332a637..0b05d91 100644
--- a/util.c
+++ b/util.c
@@ -17,7 +17,7 @@ struct server s;
 static void
 verr(const char *fmt, va_list ap)
 {
-       if (argv0 && strncmp(fmt, "usage", strlen("usage"))) {
+       if (argv0 && strncmp(fmt, "usage", sizeof("usage") - 1)) {
                fprintf(stderr, "%s: ", argv0);
        }
 

Reply via email to