aboutsummaryrefslogtreecommitdiff
path: root/modutils/insmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'modutils/insmod.c')
-rw-r--r--modutils/insmod.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index a81ca7fba..b9d8a0243 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -4262,6 +4262,7 @@ int insmod_ng_main(int argc, char **argv)
4262{ 4262{
4263 long ret; 4263 long ret;
4264 size_t len; 4264 size_t len;
4265 int optlen;
4265 void *map; 4266 void *map;
4266 char *filename, *options; 4267 char *filename, *options;
4267 4268
@@ -4270,12 +4271,12 @@ int insmod_ng_main(int argc, char **argv)
4270 bb_show_usage(); 4271 bb_show_usage();
4271 4272
4272 /* Rest is options */ 4273 /* Rest is options */
4273 options = xstrdup(""); 4274 options = xzalloc(1);
4275 optlen = 0;
4274 while (*++argv) { 4276 while (*++argv) {
4275 int optlen = strlen(options);
4276 options = xrealloc(options, optlen + 2 + strlen(*argv) + 2); 4277 options = xrealloc(options, optlen + 2 + strlen(*argv) + 2);
4277 /* Spaces handled by "" pairs, but no way of escaping quotes */ 4278 /* Spaces handled by "" pairs, but no way of escaping quotes */
4278 sprintf(options + optlen, (strchr(*argv,' ') ? "\"%s\" " : "%s "), *argv); 4279 optlen += sprintf(options + optlen, (strchr(*argv,' ') ? "\"%s\" " : "%s "), *argv);
4279 } 4280 }
4280 4281
4281#if 0 4282#if 0