Dimitrie O. Paun wrote:
+void deletePath( char *path ) +{
- SHFILEOPSTRUCT fileop;
- path[strlen( path ) + 1] = '\0';
We do not have space allocated for this NUL.
Se later down this message...
Here we use the advanced Shell API but later not the Win32 API for opening files and such. What is our policy?
No policy. Jakob wrote this one, and I just used it. If it were the only thing imported from shell32, I'd get rid of it, but we also need the ShellExecute().
My thought exactly. I also tried to write a recursive delete using plain Win32 but failed miserably. :-)
- char line[512], *cmd;
Fixed size buffers are wrong...
Oh come on, it's just a temp buffer to copy stuff through. It introduces no limitation.
Yep. Same thing with MAXPATH. I think I set some buffers to MAXPATH + 2 or something. Hence the extra null is accounted for.
(Why is the code not in CVS BTW? I don't know where to look.)
Why not append mode? That would also make the above redirection more secure.
Why append mode? How is it making it more secure?
I tried append mode. That screwed the file up totally when tests crashed on Win98. So I changed to "w". I don't know if this applies at all to how Dimi rewrote the program.
regards, Jakob