summaryrefslogtreecommitdiff
path: root/clients/zaway
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2009-03-22 21:03:21 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2009-03-22 21:03:21 +0000
commite48455b219606833c7adef5318d08f1572ef90a2 (patch)
tree7a7c89b3e6a279ceec5f16a3d972c8fe05ecff25 /clients/zaway
parent312324cc64cbb918e47526056de8c9c8d0693f79 (diff)
replace a malloc/strcpy with a stdup
Diffstat (limited to 'clients/zaway')
-rw-r--r--clients/zaway/zaway.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c
index a2a82f0..a2b6a96 100644
--- a/clients/zaway/zaway.c
+++ b/clients/zaway/zaway.c
@@ -174,12 +174,11 @@ main(int argc,
}
if (cmdline_msg) {
- ptr = malloc(strlen(cmdline_msg)+1);
- if (!ptr) {
- com_err(argv[0],ENOMEM,"while getting cmdline message");
- exit(1);
- }
- (void) strcpy(ptr,cmdline_msg);
+ ptr = strdup(cmdline_msg);
+ if (!ptr) {
+ com_err(argv[0],ENOMEM,"while getting cmdline message");
+ exit(1);
+ }
}
else if (fp) {
if (!(ptr = find_message(&notice,fp))) {