diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2014-03-02 21:39:01 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2014-03-03 10:37:30 +1100 |
commit | 8ce36476ae8d2541e9bf3a6c23c345ec03694ee3 (patch) | |
tree | 45c5b45b7823e9228229c0e632a524a943f9e780 | |
parent | 821acd4c171b659a682a1aa05da641246a15d51e (diff) | |
download | dtc-8ce36476ae8d2541e9bf3a6c23c345ec03694ee3.zip dtc-8ce36476ae8d2541e9bf3a6c23c345ec03694ee3.tar.gz dtc-8ce36476ae8d2541e9bf3a6c23c345ec03694ee3.tar.bz2 |
Consistently use xrealloc instead of realloc
fdtput.c:
Replace the remaining call to realloc by xrealloc.
Some redundant lines in encode_value can be saved.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r-- | fdtput.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -96,12 +96,7 @@ static int encode_value(struct display_info *disp, char **arg, int arg_count, /* enlarge our value buffer by a suitable margin if needed */ if (upto + len > value_size) { value_size = (upto + len) + 500; - value = realloc(value, value_size); - if (!value) { - fprintf(stderr, "Out of mmory: cannot alloc " - "%d bytes\n", value_size); - return -1; - } + value = xrealloc(value, value_size); } ptr = value + upto; |