Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

-nolibc problem

11 views
Skip to first unread message

Heiko Vogel

unread,
Oct 18, 2009, 5:43:21 PM10/18/09
to
Hello!

Maybe I'am blind or stupid, but I've a problem...

For a small program the user should simply provide a driveletter
within the commandline. This looks like this:

example.exe /drive:m

I have used the wizard to generate a console-application, so I've
got the wellknown "HandleOptions"- Code. Okay...

/* add your option switches here */

case 'd':
case 'D':
if (!strnicmp(argv[i]+1,"drive:",6)){
if (isalpha(argv[i][7]))
szInputDrive[0] = toupper(argv[i][7]);
break;
}

"szInputDrive" is globally defined as:

char szInputDrive[] = "*:\\";

Until now, I can't see a problem. After the HandleOptions()-call
in main() I wrote this code:


// check if we got a character from A to Z
if (szInputDrive[0] == '*') {
printf("Invalid character found or \"drive:\" switch is missing.\n\
Valid driveletters should be in the range from \"A\" to
\"Z\".\n\nPress a key.\n");
getch();
return 1;
}

The code works as expected. But if I use the "-nolibc" switch for
the Linker, it seems that szInputDrive[0] will be always '*' and
the code fails. What's wrong (with me)?

BTW:
Since some days (14. October 2009) the software "AntiVir" reports
the trojan horse

TR/Agent.53475.A

in LCC.EXE. This might be (of course) a false alarm, because the
latest version of LCC-Win32 I used until today was built in
December 2008...

More information (in german):
http://forum.avira.com/wbb/index.php?page=Thread&threadID=99723


bfn hevo

Heiko Vogel

unread,
Oct 19, 2009, 12:49:05 PM10/19/09
to
Hello again!

As I can see, you are very interested in... ;)

At first, IsCharAlpha() from USER32-DLL satisfies my needs. So I
don't need (and don't use) isalpha() from crtdll.dll in the future.

However, IsCharAlpha() is not the real answer! I've played around
with setlocale() and so on... My code still failed. Whats up?
Sorry, I don't have the time to check this "in deep" at
assembly-language level.

bfn hevo

0 new messages