aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2016-01-23 08:32:57 -0800
committerLev Walkin <vlm@lionet.info>2016-01-23 08:32:57 -0800
commit438fe8796fd1c6f270e2a98cef2958f6cacb2b02 (patch)
tree73e16836a7cf5fc2ed0981e524f5bbf60f9f906c
parentd62d7d51b06f17550e971e8aef16cb115875669a (diff)
avoid compile warning
-rw-r--r--asn1c/enber.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/asn1c/enber.c b/asn1c/enber.c
index 5b496385..6ba485bf 100644
--- a/asn1c/enber.c
+++ b/asn1c/enber.c
@@ -300,13 +300,16 @@ process_line(const char *fname, char *line, int lineno) {
}
break;
}
+ unsigned long tag_value_UL;
errno = 0;
if(!*tcl_pos
- || ((long)(tag_value = strtoul(tcl_pos, 0, 10))) < 0
+ || ((tag_value_UL = strtoul(tcl_pos, 0, 10)) > UINT_MAX)
|| errno) {
fprintf(stderr, "%s: Invalid tag value (%c) at line %d\n",
fname, *tcl_pos, lineno);
exit(EX_DATAERR);
+ } else {
+ tag_value = tag_value_UL;
}
tlv_tag = ((tag_value << 2) | tag_class);