Sync to Wine-20050419: Peter Berg Larsen pebl@math.ku.dk - Eliminate a strncpy and remove unused variable. Modified: trunk/reactos/lib/cabinet/cabextract.c _____
Modified: trunk/reactos/lib/cabinet/cabextract.c --- trunk/reactos/lib/cabinet/cabextract.c 2005-04-20 20:58:16 UTC (rev 14723) +++ trunk/reactos/lib/cabinet/cabextract.c 2005-04-20 22:05:23 UTC (rev 14724) @@ -2068,7 +2068,7 @@
*/ void find_cabinet_file(char **cabname, LPCSTR origcab) {
- char *tail, *cab, *name, *nextpart, nametmp[MAX_PATH], *filepart; + char *tail, *cab, *name, *nextpart, nametmp[MAX_PATH]; int found = 0;
TRACE("(*cabname == ^%p, origcab == %s)\n", cabname ? *cabname : NULL, debugstr_a(origcab)); @@ -2107,11 +2107,11 @@ nextpart = strchr(name, '\'); if (nextpart) *nextpart = '\0';
- found = SearchPathA(cab, name, NULL, MAX_PATH, nametmp, &filepart); + found = SearchPathA(cab, name, NULL, MAX_PATH, nametmp, NULL);
/* if the component was not found, look for it in the current dir */ if (!found) { - found = SearchPathA(".", name, NULL, MAX_PATH, nametmp, &filepart); + found = SearchPathA(".", name, NULL, MAX_PATH, nametmp, NULL); }
if (found) @@ -2135,7 +2135,7 @@ if (found) { free((void *) *cabname); *cabname = cab; - strncpy(cab, nametmp, found+1); + memcpy(cab, nametmp, found+1); TRACE("result: %s\n", debugstr_a(cab)); } else { free((void *) cab);