[ tuzlaorg @ 17.07.2001. 18:44 ] @
Imam problem sa sprintf..
int lol
char **blah;
sprintf(blah, "echo zup times %i ", lol, " sux ");

Segemtation .....
[ Vojislav Milunovic @ 17.07.2001. 21:33 ] @
Citat:
tuzlaorg je napisao:
Imam problem sa sprintf..
int lol
char **blah;
sprintf(blah, "echo zup times %i ", lol, " sux ");

Segemtation .....


Treba da bude

int lol
char *blah = malloc(100);
memset(blah,0x00,100);
sprintf(blah,"echo zup times %i %s",lol,"sux");
[ tuzlaorg @ 18.07.2001. 01:10 ] @
Kewl, Thnkx buddy,
:)
Napravio sam cronUTIL sada za onaj counter
./ugcron <max uid> <max gid> <[email protected]> <hidenfile> [optional printer device]

<*> - potrebna polja
[ ] - ne potrebno :))

tako da

./ugcron 1 1 [email protected] /root/.hidden /dev/lp0 :)

sweet :)
[ c00l_daem0n @ 18.07.2001. 10:36 ] @
nisi iskapirao pointere
[ kajla @ 18.07.2001. 10:46 ] @
Ne kapiram sto pises:
sprintf(blah,"echo zup times%i%s",lol,"sux"); kad je lepse da napises:

sprintf(blah,"echo zup times%ssux",lol)?

poz.
[ Vojislav Milunovic @ 18.07.2001. 11:12 ] @
nije mi ni palo napamet da sux ubacim u format strin,jer sa njegov post quoteovao i onda samo ispravi kod i dodao tiny %s ;o)