Unverified Commit ca65a48c authored by fei4xu's avatar fei4xu Committed by GitHub

Update asn1c-usage.tex

The encode function call will crash if it's not initialized. Update the document to make it more clear.
parent 88ed3b5c
...@@ -207,7 +207,7 @@ int main(int ac, char **av) { ...@@ -207,7 +207,7 @@ int main(int ac, char **av) {
asn_enc_rval_t ec; /* Encoder return value */ asn_enc_rval_t ec; /* Encoder return value */
/* Allocate the Rectangle_t */ /* Allocate the Rectangle_t */
rectangle = calloc(1, sizeof(Rectangle_t)); /* not malloc! */ rectangle = calloc(1, sizeof(Rectangle_t)); /* must initialize to zero, not malloc! */
if(!rectangle) { if(!rectangle) {
perror("calloc() failed"); perror("calloc() failed");
exit(1); exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment