summaryrefslogtreecommitdiffstats
path: root/src/shell.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
commit546ac7936340312cf272969ff83317ae4d50d2b4 (patch)
tree7ecadca11430c8624d9f80aae7c348fa4d65b969 /src/shell.h
parentb22364f4af3564f0dd9a5f4e150bb09747bd5c4e (diff)
downloadfastd-546ac7936340312cf272969ff83317ae4d50d2b4.tar
fastd-546ac7936340312cf272969ff83317ae4d50d2b4.zip
Introduce and use alloc helpers
These new helpers will terminate fastd on allocation failures and add some additional convenience (allow strdup with NULL; typesafe new(type) macros).
Diffstat (limited to 'src/shell.h')
-rw-r--r--src/shell.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shell.h b/src/shell.h
index 141126b..bc469c8 100644
--- a/src/shell.h
+++ b/src/shell.h
@@ -32,7 +32,7 @@
#pragma once
-#include "types.h"
+#include "alloc.h"
#include <stdlib.h>
#include <string.h>
@@ -59,7 +59,7 @@ static inline void fastd_shell_command_unset(fastd_shell_command_t *command) {
static inline void fastd_shell_command_set(fastd_shell_command_t *command, const char *val, bool sync) {
fastd_shell_command_unset(command);
- command->command = strdup(val);
+ command->command = fastd_strdup(val);
command->dir = get_current_dir_name();
command->sync = sync;
}