Bug#428892: sdl-mixer1.2: FTBFS on hurd-i386
Samuel Thibault
samuel.thibault at ens-lyon.org
Thu Jun 14 23:09:04 UTC 2007
Hi,
Oops, here is a more complete and better patch.
Samuel
-------------- next part --------------
diff -ur sdl-mixer1.2-1.2.6.orig/music_cmd.c sdl-mixer1.2-1.2.6/music_cmd.c
--- sdl-mixer1.2-1.2.6.orig/music_cmd.c 2004-12-16 05:20:14.000000000 +0000
+++ sdl-mixer1.2-1.2.6/music_cmd.c 2007-06-14 19:24:15.000000000 +0000
@@ -55,10 +55,8 @@
Mix_SetError("Out of memory");
return(NULL);
}
- strncpy(music->file, file, (sizeof music->file)-1);
- music->file[(sizeof music->file)-1] = '\0';
- strncpy(music->cmd, cmd, (sizeof music->cmd)-1);
- music->cmd[(sizeof music->cmd)-1] = '\0';
+ music->file = strdup(file);
+ music->cmd = strdup(cmmd);
music->pid = 0;
/* We're done */
@@ -153,15 +151,16 @@
/* Child process - executes here */
case 0: {
- char command[PATH_MAX];
+ char *command;
char **argv;
/* Execute the command */
- strcpy(command, music->cmd);
+ command = strdup(music->cmd);
argv = parse_args(command, music->file);
if ( argv != NULL ) {
execvp(argv[0], argv);
}
+ free(command);
/* exec() failed */
perror(argv[0]);
diff -ur sdl-mixer1.2-1.2.6.orig/music_cmd.h sdl-mixer1.2-1.2.6/music_cmd.h
--- sdl-mixer1.2-1.2.6.orig/music_cmd.h 2004-12-16 05:20:14.000000000 +0000
+++ sdl-mixer1.2-1.2.6/music_cmd.h 2007-06-14 19:24:33.000000000 +0000
@@ -33,8 +33,8 @@
# include <linux/limits.h>
#endif
typedef struct {
- char file[PATH_MAX];
- char cmd[PATH_MAX];
+ char *file;
+ char *cmd;
pid_t pid;
} MusicCMD;
More information about the Pkg-sdl-maintainers
mailing list