diff options
author | shdown <shdownnine@gmail.com> | 2015-08-03 12:50:50 +0300 |
---|---|---|
committer | shdown <shdownnine@gmail.com> | 2015-08-03 12:50:50 +0300 |
commit | c85d16faa4fa3fc34b35782d2281b5852e5a429b (patch) | |
tree | 3dfc41e86439813a1cb7b7b1c8fa03c925033ea9 /i3-nagbar | |
parent | bc52fae15c75635e9cec57e25619d304dba3a69b (diff) | |
download | i3-c85d16faa4fa3fc34b35782d2281b5852e5a429b.tar.gz i3-c85d16faa4fa3fc34b35782d2281b5852e5a429b.zip |
Use safe wrappers wherever possible
Diffstat (limited to 'i3-nagbar')
-rw-r--r-- | i3-nagbar/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index aca70ab1..d86cd69a 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -371,7 +371,7 @@ int main(int argc, char *argv[]) { if (argv0_len > strlen(".nagbar_cmd") && strcmp(argv[0] + argv0_len - strlen(".nagbar_cmd"), ".nagbar_cmd") == 0) { unlink(argv[0]); - cmd = strdup(argv[0]); + cmd = sstrdup(argv[0]); *(cmd + argv0_len - strlen(".nagbar_cmd")) = '\0'; execl("/bin/sh", "/bin/sh", cmd, NULL); err(EXIT_FAILURE, "execv(/bin/sh, /bin/sh, %s)", cmd); @@ -418,7 +418,7 @@ int main(int argc, char *argv[]) { printf("i3-nagbar [-m <message>] [-b <button> <action>] [-t warning|error] [-f <font>] [-v]\n"); return 0; case 'b': - buttons = realloc(buttons, sizeof(button_t) * (buttoncnt + 1)); + buttons = srealloc(buttons, sizeof(button_t) * (buttoncnt + 1)); buttons[buttoncnt].label = i3string_from_utf8(optarg); buttons[buttoncnt].action = argv[optind]; printf("button with label *%s* and action *%s*\n", |