Commit 71908c41 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

msvcrt: _makepath(): operate on target buffer directly.

parent c82a63ba
...@@ -857,40 +857,37 @@ VOID _makepath(char * path, const char * drive, ...@@ -857,40 +857,37 @@ VOID _makepath(char * path, const char * drive,
const char * extension) const char * extension)
{ {
char ch; char ch;
char tmpPath[MAX_PATH];
TRACE("got %s %s %s %s\n", debugstr_a(drive), debugstr_a(directory), TRACE("(%s %s %s %s)\n", debugstr_a(drive), debugstr_a(directory),
debugstr_a(filename), debugstr_a(extension) ); debugstr_a(filename), debugstr_a(extension) );
if ( !path ) if ( !path )
return; return;
tmpPath[0] = '\0'; path[0] = '\0';
if (drive && drive[0]) if (drive && drive[0])
{ {
tmpPath[0] = drive[0]; path[0] = drive[0];
tmpPath[1] = ':'; path[1] = ':';
tmpPath[2] = 0; path[2] = 0;
} }
if (directory && directory[0]) if (directory && directory[0])
{ {
strcat(tmpPath, directory); strcat(path, directory);
ch = tmpPath[strlen(tmpPath)-1]; ch = path[strlen(path)-1];
if (ch != '/' && ch != '\\') if (ch != '/' && ch != '\\')
strcat(tmpPath,"\\"); strcat(path,"\\");
} }
if (filename && filename[0]) if (filename && filename[0])
{ {
strcat(tmpPath, filename); strcat(path, filename);
if (extension && extension[0]) if (extension && extension[0])
{ {
if ( extension[0] != '.' ) if ( extension[0] != '.' )
strcat(tmpPath,"."); strcat(path,".");
strcat(tmpPath,extension); strcat(path,extension);
} }
} }
strcpy( path, tmpPath );
TRACE("returning %s\n",path); TRACE("returning %s\n",path);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment