summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-01-22 09:57:58 +0100
committerJeremy Allison <jra@samba.org>2015-01-22 20:29:06 +0100
commiteb1bf816b6fb0e3bc9b8a872e59223e552545bf2 (patch)
tree34a0420eac0aa3d84b3bc7fafbb193934ab133a3 /source3/client
parent63552f1c4c05a710143f12c2269754d0e547d945 (diff)
downloadsamba-eb1bf816b6fb0e3bc9b8a872e59223e552545bf2.tar.gz
s3-smbspool: Use strtol() instead of atoi().
This fixes a coverity warning. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/smbspool.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index ddae1a67852..21110b7151e 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -151,7 +151,14 @@ main(int argc, /* I - Number of command-line arguments */
perror("ERROR: Unable to open print file");
goto done;
} else {
- copies = atoi(argv[4]);
+ char *p = argv[4];
+ char *endp;
+
+ copies = strtol(p, &endp, 10);
+ if (p == endp) {
+ perror("ERROR: Unable to determine number of copies");
+ goto done;
+ }
}
/*