stupid C question

Douglas J Hunley doug
Mon May 17 11:47:18 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

$DEITY it's been forever since I mucked with C...

if I have:
char offset_filename[MAX};
<blah>
strcat(offset_filename,argv[1]);
strcat(offset_filename,".offset");

and I call the program like:
a /some/path/to/file

then offset_filename becomes /some/path/to/file.offset

how in the $PURGATORY do I modify that code to replace /some/path/to with 
/my/hardcoded/path/to so that calling the program like:
a /some/path/to/file

ends up with offset_filename being:
/my/hardcoded/path/to/file.offset

(note that 'file' is still pulled from the argv[1])

thanks!
- -- 
Douglas J Hunley (doug at hunley.homeip.net) - Linux User #174778
Admin: Linux StepByStep - http://www.linux-sxs.org
	and http://jobs.linux-sxs.org

printk("autofs: Out of inode numbers -- what the heck did you do??\n"); 
	2.0.38 /usr/src/linux/fs/autofs/root.c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+wovv2MO5UukaubkRAkyxAJ49LZ5UCkkLFUdgUjeCa8eJBz7OtQCfeTLc
DqAQnbWBTLmNxWiG4JnHmQA=
=7vrC
-----END PGP SIGNATURE-----




More information about the Linux-users mailing list