system()
Christos Ricudis
ricudis at paiko.gr
Mon Aug 23 20:42:26 EEST 1999
Hello Linux-greek-users!
On 23 Aug 99, Linux-greek-users wrote to NooBiouZ the UnstoPPaBLouZ SeXiouZ
with subject "Re: system()":
L> thanx all gia th boitheia....
L> brika telikws th lysh alla oxi sthn fgets alla sketo gets
L> thanx pou me balate se swsto dromo
Ksexases na kaneis bounds checking. Kalytera na sou ginei synh8eia apo nwris,
giati sto telos 8a thn plhrwseis akriba me ta dedomena sou :) :
L> #include <stdio.h>
L> #define data
Edw kati ksexases. (#define data 100 h kapoio allo mege8os buffer)
L> main()
L> {
L> char album[data];
L> printf("dwse to onoma tou album:");
L> gets(album); /* thanx for the hint edw.... */
fgets(album,data,STDIN);
L> puts(album);
L> }
L> To pws tha to metaferw auto to string se shell command paramenei
L> to problima....
Etsi :
snprintf(allosbuf,sizeof(allosbuf),"ls -l %s",album);
system(allosbuf);
--
Christos Ricudis
I am a target. Please bomb me at N40 33.765' E22 55.130' Alt. 69ft
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================
More information about the Linux-greek-users
mailing list