| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: DosExecPgm |
>BP> "APPNAME\0%s\0%s\0%s\0\0" NF>Won't sprintf get stuck with the first \0 and think it's the NF>string termination? NF>Perhaps it should be better sprintf( buffer, NF>"APPNAME%c%s%c%s.....%c%c", '\0', FirstParam, '\0', SecondParam, NF>'\0', NF>....., '\0', '\0' ); All you need is: sprintf(string,"%s%c%s%c%c",appname,'\0',(args) ? args : "",'\0','\0'); If there are no args (args is NULL or ""), there'll be an extra '\0' on the end of string -- won't hurt anything. Although you need to separate the arguments from the appname, you don't have to separate the arguments into separate pieces, according to the "convention used by CMD.EXE" as detailed in the toolkit docs. So, for an example, appname could be "CMD.EXE" and args could be "/C DIR /W". --- XHEd-OS/2 1.22* Origin: The Pit (1:380/16) SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430 SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1 @PATH: 380/25 3615/50 229/2 12/2442 711/409 808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.