]> git.proxmox.com Git - wasi-libc.git/commitdiff
Fix a warning.
authorDan Gohman <dev@sunfishcode.online>
Fri, 5 Feb 2021 02:16:12 +0000 (18:16 -0800)
committerDan Gohman <dev@sunfishcode.online>
Fri, 5 Feb 2021 05:23:10 +0000 (21:23 -0800)
libc-bottom-half/sources/getcwd.c

index 6a2080ec51bd9bb626fb8d653575afadf6acdcd1..6fea2a20d052b011c0ba1addb7af68fd75ee934b 100644 (file)
@@ -19,7 +19,7 @@ char *getcwd(char *buf, size_t size)
         }
     } else {
         size_t len = strlen(__wasilibc_cwd);
-        if (size < strlen(__wasilibc_cwd) + 1) {
+        if (size < len + 1) {
             errno = ERANGE;
             return NULL;
         }