- nl = strrchr(script_cmd_buf, '\n');
- if (nl) *nl = '\0';
-
- if ((cmd = (char*) malloc(strlen(script_cmd_buf) + 1)) != NULL) {
- memset(cmd, 0, strlen(script_cmd_buf));
- strcpy(cmd, script_cmd_buf);
- printf("%s\n", cmd);
- }
- }
- }
-
- if (!script_file) {
- cmd = readline(PROXPROMPT);
+ nl = strrchr(script_cmd_buf, '\n');
+
+ if (nl)
+ *nl = '\0';
+
+ int newlen = strlen(script_cmd_buf);
+ if ((cmd = (char*) malloc( newlen + 1)) != NULL) {
+ memset(cmd, 0x00, newlen);
+ strcpy(cmd, script_cmd_buf);
+ printf("%s\n", cmd);
+ }
+ }
+ } else {
+ cmd = readline(PROXPROMPT);