summaryrefslogtreecommitdiff
path: root/hex.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-09 14:55:20 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-09 14:55:20 +0000
commita6bf685ec3f64c3eae2d799aa1ebbdaa8f1de236 (patch)
treeda95ae608aa55f8d8f97ec9bacc091f6b675c7a6 /hex.c
parentbefe1eaba3c5bbd09da277a77acae6d0fe4fbca0 (diff)
downloadgpsd-a6bf685ec3f64c3eae2d799aa1ebbdaa8f1de236.tar.gz
Improve error detection from gpsd_hexpack().
Diffstat (limited to 'hex.c')
-rw-r--r--hex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hex.c b/hex.c
index 2c7170a0..f09f6159 100644
--- a/hex.c
+++ b/hex.c
@@ -58,7 +58,7 @@ int gpsd_hexpack(char *src, char *dst, size_t len){
l = (int)(strlen(src) / 2);
if ((l < 1) || ((size_t)l > len))
- return -1;
+ return -2;
bzero(dst, (int)len);
for (i = 0; i < l; i++)