aboutsummaryrefslogtreecommitdiffstats
path: root/xmlcatalog.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmlcatalog.c')
-rw-r--r--xmlcatalog.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmlcatalog.c b/xmlcatalog.c
index 3f153698..e0828faa 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -72,17 +72,23 @@ xmlShellReadline(const char *prompt) {
return (line_read);
#else
char line_read[501];
+ char *ret;
+ int len;
if (prompt != NULL)
fprintf(stdout, "%s", prompt);
if (!fgets(line_read, 500, stdin))
return(NULL);
line_read[500] = 0;
- return(strdup(line_read));
+ len = strlen(line_read);
+ ret = (char *) malloc(len + 1);
+ if (ret != NULL) {
+ memcpy (ret, line_read, len + 1);
+ }
+ return(ret);
#endif
}
-
static void usershell(void) {
char *cmdline = NULL, *cur;
int nbargs;