summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2015-01-21 09:37:23 -0200
committerLucas De Marchi <lucas.demarchi@intel.com>2015-01-21 10:18:44 -0200
commit88f6ffe449fc1c92725615348b63c4b59bb50921 (patch)
tree7f18df56e5c9f0465fc9d4d088433277c396f4b4 /shared
parent211e3840fc53d001fe829ae08676b6ec6cfa07a6 (diff)
downloadkmod-88f6ffe449fc1c92725615348b63c4b59bb50921.tar.gz
kmod-88f6ffe449fc1c92725615348b63c4b59bb50921.tar.bz2
kmod-88f6ffe449fc1c92725615348b63c4b59bb50921.zip
util: remove dead code in freadline_wrapped
Each loop iteration starts with 'i < size'. When i is changed the invariant is kept by checking if 'i == size' and growing the buffer.
Diffstat (limited to 'shared')
-rw-r--r--shared/util.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/shared/util.c b/shared/util.c
index 479f0fe..1a2b17c 100644
--- a/shared/util.c
+++ b/shared/util.c
@@ -314,13 +314,7 @@ char *freadline_wrapped(FILE *fp, unsigned int *linenum)
n++;
{
- char *ret;
- if (i == size) {
- ret = realloc(buf, size + 1);
- if (!ret)
- return NULL;
- } else
- ret = buf;
+ char *ret = buf;
ret[i] = '\0';
buf = NULL;
if (linenum)