diff options
Diffstat (limited to 'hw/kdrive/src/kdrive.c')
-rw-r--r-- | hw/kdrive/src/kdrive.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 8dd039e1d..f6cc351cd 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -113,19 +113,14 @@ KdDisableScreen (ScreenPtr pScreen) } static void -KdDoSwitchCmd (char *reason) +KdDoSwitchCmd (const char *reason) { if (kdSwitchCmd) { - char *command = malloc(strlen (kdSwitchCmd) + - 1 + - strlen (reason) + - 1); - if (!command) + char *command; + + if (asprintf(&command, "%s %s", kdSwitchCmd, reason) == -1) return; - strcpy (command, kdSwitchCmd); - strcat (command, " "); - strcat (command, reason); system (command); free(command); } @@ -258,7 +253,7 @@ Bool kdDumbDriver; Bool kdSoftCursor; char * -KdParseFindNext (char *cur, char *delim, char *save, char *last) +KdParseFindNext (char *cur, const char *delim, char *save, char *last) { while (*cur && !strchr (delim, *cur)) { |