|
From: Christian W. <Chr...@vo...> - 2001-10-18 12:38:34
|
Hi list,
I try to write a little Dos-tool.
If I want to get the parameters and the user has no parameters specified I
get an exception.
I think the error comes if i call strlen() with an empty string...
How can i handle this error, has anyone an idea ????
----------------Schnipp---------------------
//Get commandline
strcpy(szDatei, argv[1]);
for (nCount = 2; argc > nCount; ++nCount)
{
strcat(szDatei, " \0");
strcat(szDatei, argv[nCount]);
};
//Check Commandline
if (strlen(szDatei) <= 5)
{
printf("Wrong parameter !");
};
-------------------Schnapp------------------
Thanx for help
Chris
Diese Mail wurde auf Viren überprüft.
This mail was checked for virusses.
|