Commit 6443fa05 authored by Petr Baudis's avatar Petr Baudis
Browse files

compctld: Remove bogus usage of sizeof() on strings

parent 0222727f
......@@ -16,7 +16,7 @@
#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
......@@ -206,7 +206,7 @@ sockerror:
mprintf(fd, "1 blessed");
} else if (begins_with("stop ", line)) {
pid_t pid = atoi(line + sizeof("stop "));
pid_t pid = atoi(line + strlen("stop "));
/* Sanity check. */
if (pid < 10 || pid > 32768) {
......@@ -243,7 +243,7 @@ sockerror:
free(tasks);
} 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;
memory_limits(&minuser, &mincomp, &maxcomp, &total);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment