$OpenBSD: patch-src_SoundEvents_c,v 1.1.1.1 2001/01/09 21:01:14 naddy Exp $ --- src/SoundEvents.c.orig Wed Jan 19 15:35:15 2000 +++ src/SoundEvents.c Tue Jan 9 21:43:40 2001 @@ -200,7 +200,7 @@ browseClick(WMWidget *w, void *data) WMSetButtonEnabled(panel->sndsetsaveB, NO); if ((strcmp(panel->lastBrowseDir,"\0") == 0)) { - strcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/Sounds")); + strlcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/Sounds"), sizeof(path)); spath = wmalloc(strlen(path)+2); strcpy(spath, path); } @@ -216,7 +216,7 @@ browseClick(WMWidget *w, void *data) char *filename; filename = WMGetFilePanelFileName(browseP); - strcpy(panel->lastBrowseDir,(getPathFromName(filename))); + strlcpy(panel->lastBrowseDir, (getPathFromName(filename)), sizeof(panel->lastBrowseDir)); WMSetTextFieldText(panel->sndfileT,checkSoundPath(filename)); SetStringForKey(WMGetTextFieldText(panel->sndfileT), eventkey[WMGetPopUpButtonSelectedItem(panel->sndevntP)]); free(filename); @@ -243,7 +243,7 @@ loadClick(WMWidget *w, void *data) WMSetButtonEnabled(panel->sndsetsaveB, NO); if ((strcmp(panel->lastLoadDir,"\0") == 0)) { - strcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/SoundSets")); + strlcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/SoundSets"), sizeof(path)); spath = wmalloc(strlen(path)+2); strcpy(spath, path); } @@ -259,7 +259,7 @@ loadClick(WMWidget *w, void *data) char *filename; filename = WMGetFilePanelFileName(loadP); - strcpy(panel->lastLoadDir,(getPathFromName(filename))); + strlcpy(panel->lastLoadDir, (getPathFromName(filename)), sizeof(panel->lastLoadDir)); newset = PLGetProplistWithPath(filename); if(!newset) @@ -297,7 +297,7 @@ saveClick(WMWidget *w, void *data) WMSetButtonEnabled(panel->sndsetsaveB, NO); if ((strcmp(panel->lastSaveDir,"\0") == 0)) { - strcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/SoundSets")); + strlcpy(path, wexpandpath("~/GNUstep/Library/WindowMaker/SoundSets"), sizeof(path)); spath = wmalloc(strlen(path)+2); strcpy(spath, path); } @@ -312,7 +312,7 @@ saveClick(WMWidget *w, void *data) if (WMRunModalFilePanelForDirectory(saveP, panel->win, spath , NULL, NULL)) { char *filename = NULL; filename = WMGetFilePanelFileName(saveP); - strcpy(panel->lastSaveDir,(getPathFromName(filename))); + strlcpy(panel->lastSaveDir, (getPathFromName(filename)), sizeof(panel->lastSaveDir)); file = fopen (filename, "w+"); if (file) {