Skip to content
Snippets Groups Projects
Commit 6443fa05 authored by Petr Baudis's avatar Petr Baudis
Browse files

compctld: Remove bogus usage of sizeof() on strings

parent 0222727f
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "common.h" #include "common.h"
#define begins_with(s_, a_) (!strncmp(s_, a_, sizeof(s_) - 1)) #define begins_with(s_, a_) (!strncmp(s_, a_, strlen(s_)))
void void
...@@ -206,7 +206,7 @@ sockerror: ...@@ -206,7 +206,7 @@ sockerror:
mprintf(fd, "1 blessed"); mprintf(fd, "1 blessed");
} else if (begins_with("stop ", line)) { } else if (begins_with("stop ", line)) {
pid_t pid = atoi(line + sizeof("stop ")); pid_t pid = atoi(line + strlen("stop "));
/* Sanity check. */ /* Sanity check. */
if (pid < 10 || pid > 32768) { if (pid < 10 || pid > 32768) {
...@@ -243,7 +243,7 @@ sockerror: ...@@ -243,7 +243,7 @@ sockerror:
free(tasks); free(tasks);
} else if (begins_with("limitmem ", line)) { } else if (begins_with("limitmem ", line)) {
size_t limit = atol(line + sizeof("limitmem ")); size_t limit = atol(line + strlen("limitmem "));
size_t minuser, mincomp, maxcomp, total; size_t minuser, mincomp, maxcomp, total;
memory_limits(&minuser, &mincomp, &maxcomp, &total); memory_limits(&minuser, &mincomp, &maxcomp, &total);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment