##// END OF EJS Templates
osutil: stop using strcpy...
Augie Fackler -
r28593:e60c492a default
parent child Browse files
Show More
@@ -203,14 +203,15 b' static PyObject *_listdir(char *path, in'
203 PyErr_NoMemory();
203 PyErr_NoMemory();
204 goto error_nomem;
204 goto error_nomem;
205 }
205 }
206 strcpy(pattern, path);
206 memcpy(pattern, path, plen);
207
207
208 if (plen > 0) {
208 if (plen > 0) {
209 char c = path[plen-1];
209 char c = path[plen-1];
210 if (c != ':' && c != '/' && c != '\\')
210 if (c != ':' && c != '/' && c != '\\')
211 pattern[plen++] = '\\';
211 pattern[plen++] = '\\';
212 }
212 }
213 strcpy(pattern + plen, "*");
213 pattern[plen++] = '*';
214 pattern[plen] = '\0';
214
215
215 fh = FindFirstFileA(pattern, &fd);
216 fh = FindFirstFileA(pattern, &fd);
216 if (fh == INVALID_HANDLE_VALUE) {
217 if (fh == INVALID_HANDLE_VALUE) {
General Comments 0
You need to be logged in to leave comments. Login now