aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-24 00:07:10 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-24 00:07:10 +0200
commitf8e0a25c18e689d6771afa6ea34b0a0667795340 (patch)
tree0136862f04bcdbaf5c3e73090179aab333e9e081 /src
parentwe got code (diff)
downloadsetpgrp-f8e0a25c18e689d6771afa6ea34b0a0667795340.tar.gz
setpgrp-f8e0a25c18e689d6771afa6ea34b0a0667795340.tar.bz2
setpgrp-f8e0a25c18e689d6771afa6ea34b0a0667795340.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/setpgrp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/setpgrp.c b/src/setpgrp.c
index e1f595e..976b10f 100644
--- a/src/setpgrp.c
+++ b/src/setpgrp.c
@@ -30,15 +30,15 @@ int main(int argc, char* argv[])
int switch_help = 0;
pid_t group;
char** args;
- size_t off;
+ int off;
- for (off = 1; off < (size_t)argc; off++)
+ for (off = 1; off < argc; off++)
if (!strcmp(argv[off], "--print"))
switch_print = 1;
else if (!strcmp(argv[off], "--export"))
{
switch_export = ++off;
- if (off == (size_t)argc)
+ if (off == argc)
goto help;
}
else if (!strcmp(argv[off], "--help"))
@@ -61,11 +61,11 @@ int main(int argc, char* argv[])
goto fail;
group = getpgrp();
- args = malloc(argc * sizeof(char*));
+ args = malloc((size_t)argc * sizeof(char*));
if (args == NULL)
goto fail;
- memcpy(args, argv + off, ((size_t)argc - off) * sizeof(char*));
+ memcpy(args, argv + off, (size_t)(argc - off) * sizeof(char*));
args[argc - 1] = NULL;
if (switch_print)