summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-05 14:08:28 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-19 03:54:37 +0200
commitd3d9ad14aca343841ab6baaa1aedb50521513285 (patch)
tree5c3861ea7a5daa7e425d167d2335165d69ffd5d6
parentWsometimes-uninitialized (diff)
downloadcore-feature/mar-updater.tar.gz
core-feature/mar-updater.zip
Wdeclaration-after-statement feature/mar-updater
Change-Id: Ie3a34305c824e2f04feb8b1db39c0df342588c43 Reviewed-on: https://gerrit.libreoffice.org/37797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--onlineupdate/source/libmar/tool/mar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/onlineupdate/source/libmar/tool/mar.c b/onlineupdate/source/libmar/tool/mar.c
index 232e4e0c220a..d67935bd559d 100644
--- a/onlineupdate/source/libmar/tool/mar.c
+++ b/onlineupdate/source/libmar/tool/mar.c
@@ -272,10 +272,11 @@ int main(int argc, char **argv) {
while(fgets(buf, 1000, file) != NULL)
{
int j;
+ size_t str_len;
for (j=strlen(buf)-1;j>=0 && (buf[j]=='\n' || buf[j]=='\r');j--)
;
buf[j+1]='\0';
- size_t str_len = strlen(buf) + 1;
+ str_len = strlen(buf) + 1;
files[num_files] = (char*)malloc(sizeof(char)*str_len);
strcpy(files[num_files], buf);
++num_files;