On Sun, 18 Nov 2012 15:22:59 +0100, John Tytgat wrote:
> > -/* Menu event handlers: */
> > -static void __CDECL menu_about(WINDOW *win, int item, int title, void *data)
> > +static void __CDECL menu_about(short item, short title, void *data)
> > {
> > LOG(("%s", __FUNCTION__));
> > char buf[PATH_MAX];
> > strcpy((char*)&buf, "file://");
>
> Why not simply: strcpy(buf, "file://") ?
>
> > - strncat((char*)&buf, (char*)"./doc/README.TXT", PATH_MAX - (strlen("file://")+1) );
> > + strncat((char*)&buf, (char*)"./doc/README.TXT",
>
> Why you need a char * cast of a const string ? We have
> "char *strncat(char *, const char *, size_t)" so there is no need for
> the 2nd char * cast.
>
> > + PATH_MAX - (strlen("file://")+1) );
> > browser_window_create((char*)&buf, 0, 0, true, false);
>
> But more importantly, why not a simple
> browser_window_create("file://./doc/README.TXT", 0, 0, true, false); ?
This is stuff that has been merged in; it's actually nothing to do
with my branch.
Having said that, I'd have thought "file://./doc/README.TXT" should be
something like "resource:README.TXT". Vince will need to respond to
this as I don't know the context or why there is a hard-coded path
there.
Chris
No comments:
Post a Comment