Package: xtranslate Version: 0.2-10 Severity: important Tags: patch Hi,
please find in this mail a patch wich fixes a application crash documented in https://launchpad.net/distros/ubuntu/+source/xtranslate/+bug/3807 and it closes as well bts #349444/#349446. Regards, \sh --- debian/xtranslate-0.2/xtranslate.c 1999-06-15 21:19:55.000000000 +0200 +++ xtranslate-0.2/xtranslate.c 2006-01-23 21:36:57.923454648 +0100 @@ -24,18 +24,23 @@ #include <string.h> #include <stdio.h> -void main(int argc, char *argv[]) +int main(int argc, char *argv[]) { Display *display = XOpenDisplay(""); char *string, *wort; int bytes,i; + if (!display) { + fprintf(stderr,"No DISPLAY environment variable set. Please set you DISPLAY environment properly!\n"); + exit(EXIT_FAILURE); + } + XConvertSelection(display, XA_PRIMARY, XA_STRING, XA_CUT_BUFFER0, XDefaultRootWindow(display), CurrentTime); string = XFetchBytes(display, &bytes); - wort = malloc((char) "TRANSLATEWORD="); + wort = malloc(sizeof("TRANSLATE_WORD=")); strcpy(wort,"TRANSLATE_WORD="); for ( i=1; i < argc;i++) { @@ -59,4 +64,5 @@ unsetenv(wort); XFree(string); XCloseDisplay(display); + return(0); }
pgpl0m36eirc3.pgp
Description: PGP signature