Hi Przemek,
Nice to see you back.
; Przemek, could you double check these changes pls?
I can send you the .diff if it helps.
I've just created one myself.
In few places this modifications are wrong and introduced bugs.
F.e. In DBFNTX replacing strncpy() by hb_strncpy() causes that
setting 'key_expr' damages 'unique' flag.
In most of cases when I was using strncpy() instead of hb_strncpy()
it was intentional because trailing 0 was not necessary or even
_MUST_NOT_BE_ set when string allocates whole buffer, f.e. in
low RDD structures.
Okay, can we someone make it like it so that we can
differentiate between legitimate and intentional
usage and possible mistakes? Maybe a macro, or comment
would do good.
Also, would you prefer to refix those parts which are
now wrong or should I just revert some or all of them?
I also do not find replacing all:
hb_strncpy( dest, src, CONST_DEFINE )
with:
hb_strncpy( dest, src, sizeof( dest ) - 1 )
as good idea because it will make code updating harder in some
cases, f.e. when I will want to change in some structure:
struct
{
...
char szBuffer[ BUFF_SIZE ];
...
}
with:
struct
{
...
char *szBuffer;
...
}
Yes, it's the only disadvantage I could actually find.
Dunno how this will be a problem in practice, pls
advise what to do.
to allocate buffer dynamically. Now I will have to check and updated
all places where szBuffer is set and restore previous version.
In many places the above modifications were really good idea but
I will have to revert them in some others to fix bugs and for easier
code modifications in the future. I'll try to check them carefully.
BTW: in contrib/hbwhat32/_winmain.c we have yet another WinMain()
implementation. I guest it exists for some historical reasons.
It should be removed and additional functions should be changed
to use variables set by source/vm/mainwin.c
Okay, I'll try to do that.
Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour