openbsd-ports/graphics/glut/patches/patch-lib_mui_browser_c
2007-04-02 19:57:48 +00:00

31 lines
1.0 KiB
Plaintext

$OpenBSD: patch-lib_mui_browser_c,v 1.2 2007/04/02 19:57:48 martynas Exp $
--- lib/mui/browser.c.orig Sat Aug 8 02:15:28 1998
+++ lib/mui/browser.c Mon Apr 2 11:35:06 2007
@@ -176,7 +176,7 @@ void handletextbox(muiObject *obj, enum muiReturnValue
strncpy(directory, s, slash-s);
directory[slash-s] = 0;
} else {
- strcat(directory, "/");
+ strlcat(directory, "/", sizeof(directory));
strncat(directory, s, slash-s);
}
}
@@ -233,7 +233,7 @@ void maketestui(void)
muiSetCallback(tl, handlefileselection);
cd(directory);
- strcpy(originaldir, directory);
+ strlcpy(originaldir, directory, sizeof(originaldir));
}
void main(int argc, char **argv)
@@ -243,7 +243,7 @@ void main(int argc, char **argv)
f = fopen(BROWSEFILE, "r");
parsebrowsefile(f);
fclose(f);
- strcpy(directory, currentdirectoryname);
+ strlcpy(directory, currentdirectoryname, sizeof(directory));
maketestui();
glutInit(&argc, argv);
if (argc > 1) mui_singlebuffered = 1;