I couldn't figure out why there are junk data being output to the stdout:

My stdout look like below:
07/23/2008 15:30:16 argv[0]->PALHC/ECD_STP3

07/23/2008 15:30:23 argv[1]->NOCC07QA ð5553
d20080723152951972824

07/23/2008 15:30:31 argv[2]->5553 d2008072315295197
2824





The coding look something like below:

char printThisBuf[110];

sprintf(printThisBuf, "argv[0]->%s\n", argv[0]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[1]->%s\n", argv[1]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[2]->%s\n", argv[2]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[3]->%s\n", argv[3]);
printThis(printThisBuf);


void
printThis(char *text)
{
char stime[20];

memset(stime, 0x0, sizeof(stime));
get_time_stamp(stime);
printf("%s %s\n", stime, text);
}

int get_time_string(char sTime[])
{
time_t thetime;
struct tm *usetime;
char sString[10];

time(&thetime);
usetime=localtime(&thetime);
sprintf(sTime,"%02d:",usetime->tm_hour);
sprintf(sTime+3,"%02d:",usetime->tm_min );
sprintf(sTime+6,"%02d",usetime->tm_sec );
return(1);
}


I call the program like this:
CALL PGM(*LIBL/RUN_ECDSTP) PARM('NOCC07QA' '5553' '*LIBL' UA_STP3)

can somebody help?

thanks

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].