Hi!
10-Дек-2005 10:09 [EMAIL PROTECTED] (Kenneth Davis) wrote to
[EMAIL PROTECTED]:
> +++ dir.c 10 Dec 2005 10:09:43 -0000 1.26
> +#ifdef FEATURE_LONG_FILENAMES
> void printLFNname(char *shortName, char *ext)
> {
> char pathbuffer[128];
> + char longname[270];
> + /* reconstruct the path+filename */
> pathlen = strrchr(path,'\\') - path;
> sprintf(pathbuffer,"%*.*s\\%s%c%s"
In memory of defensive programming:
- strrchr() may return NULL (I think, in many cases most standard functions
should be replaced by own versions with more safe characteristics);
- pathbufer shorter than longname.
> + /* LFN get canonical LFN */
> r.r_ds = FP_SEG(pathbuffer);
> + r.r_si = FP_OFF(pathbuffer);
> + printf(" %.30s ", &strrchr(longname, '\\')[1]);
--------------------------^-----------------------^^^
This is same as "strrchr() + 1".
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Freedos-kernel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel