aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-26 15:07:17 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-26 15:07:17 +0100
commite8a5fc042a205ea2930d6c3d41929bf18a4a2344 (patch)
tree49fc9c7f02813ab84b575ca2efbb389253061c55
parentmarshalled arrays are not empty-element-terminated (diff)
downloadsat-e8a5fc042a205ea2930d6c3d41929bf18a4a2344.tar.gz
sat-e8a5fc042a205ea2930d6c3d41929bf18a4a2344.tar.bz2
sat-e8a5fc042a205ea2930d6c3d41929bf18a4a2344.tar.xz
job ids must not be empty strings
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--src/satr.c3
-rw-r--r--src/satrm.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/satr.c b/src/satr.c
index d432343..ef5da6e 100644
--- a/src/satr.c
+++ b/src/satr.c
@@ -21,6 +21,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include "client.h"
@@ -70,7 +71,7 @@ main(int argc, char *argv[])
if (!strcmp(argv[1], "--"))
argv++, argc--;
for (i = 1; i < argc; i++)
- if (argv[i][0] == '-')
+ if (strchr("-", argv[i][0]))
usage();
n = measure_array(argv + 1);
diff --git a/src/satrm.c b/src/satrm.c
index 8097b18..28bea0b 100644
--- a/src/satrm.c
+++ b/src/satrm.c
@@ -21,6 +21,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include "client.h"
@@ -69,7 +70,7 @@ main(int argc, char *argv[])
if (!strcmp(argv[1], "--")
argv++, argc--;
for (i = 1; i < argc; i++)
- if (argv[i][0] == '-')
+ if (strchr("-", argv[i][0]))
usage();
if (!(msg = malloc(n = measure_array(argv + 1))))