This is a new set of potential bugs found via Viva64:
Example 1. ReactOS project. Incorrect printing of a WCHAR-character( regproc.c 293) . static void REGPROC_unescape_string(WCHAR* str) { ... default: fprintf(stderr, "Warning! Unrecognized escape sequence: \%c'\n", str[str_idx]); ... }Reason: To fix the code, we should replace '%c' with '%C' in the format string.
Example 2. ReactOS project. Assignment error. (menu.c 4347) BOOL WINAPI GetMenuItemInfoA(...) { ... mii->cch = mii->cch; ... } Example 16. ReactOS project. Misprint in a macro.( win32k gradient.c 343 )
#define SWAP(a,b,c) c = a;\ a = b;\ a = c Example 8. ReactOS object. Choosing a wrong object. void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal) { ... HPEN hhi = CreatePen(0, 0, MAKE_PALETTERGB(crHighlight)); HPEN hsh = CreatePen(0, 0, MAKE_PALETTERGB(crShadow)); ... if(fNormal) hOld = SelectObject(hdc, hhi); else hOld = SelectObject(hdc, hhi); ... } The 'then' statement is equivalent to the 'else' statement. cardlib cardbutton.cpp 83 The 'hsh' object is not used, while 'hhi' is used twice. This is the correct code: if(fNormal)
hOld = SelectObject(hdc, hhi); else
hOld = SelectObject(hdc, hsh); Example 10. ReactOS project. Mistake in a variable name. BOOL APIENTRY GreStretchBltMask(...)
{
...
MaskPoint.x += DCMask->ptlDCOrig.x;
MaskPoint.y += DCMask->ptlDCOrig.x; ... } Consider reviewing the correctness of 'x' item's usage. win32k bitblt.c 670
Example 4. ReactOS project. Incorrect calculation of a string length ( vbe.c 57 ) static const PCHAR Nv11Board = "NV11 (GeForce2) Board"; static const PCHAR Nv11Chip = "Chip Rev B2"; static const PCHAR Nv11Vendor = "NVidia Corporation"; BOOLEAN IsVesaBiosOk(...) { ... if (!(strncmp(Vendor, Nv11Vendor, sizeof(Nv11Vendor))) && !(strncmp(Product, Nv11Board, sizeof(Nv11Board))) && !(strncmp(Revision, Nv11Chip, sizeof(Nv11Chip))) && (OemRevision == 0x311)) ... }Reason: The error here is this: the sizeof() operator, absolutely inappropriate in this situation, is used to calculate string lengths. The sizeof() operator actually calculates the pointer size instead of the number of bytes in a string.
In this case Abragin said this is not a bug.
I'm sending here to discuss about them ;).Are they valid? Link: http://www.viva64.com/en/a/0079/
Hi Vic,
You know, sometimes I really don't understand your reasoning.
We decided that the guy is a bastard, and so even if we wanted to talk about his tool, we could do so on irc or something, not doing him even more free PR work through our ML, which will be all over google index.
Engaging in any relation with this guy is a slap to our face.
Cheers, Amine.
On Mar 16, 2012, at 10:06 AM, Amine Khaldi wrote:
Hi Vic,
You know, sometimes I really don't understand your reasoning.
We decided that the guy is a bastard, and so even if we wanted to talk about his tool, we could do so on irc or something, not doing him even more free PR work through our ML, which will be all over google index.
Engaging in any relation with this guy is a slap to our face.
Cheers, Amine.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
What's the issue? These all (apart from the last) seem like perfectly valid bugs.
Regards, Cameron
On 16.03.2012 18:06, Amine Khaldi wrote:
We decided that the guy is a bastard, and so even if we wanted to talk about his tool, we could do so on irc or something, not doing him even more free PR work through our ML, which will be all over google index.
Speaking of Google index, let's be more polite in public mailing lists. Vic picked up only appropriate problems, with minimum references to the actual tool, so it's nothing dramatic.
WBR, Aleksey Bragin.
Hi Amine, I'll try to explain then my reasoning. 1)Politeness. Even if he is a dumbass(or not) we should be polite.Even more if he provides a list of useful and valid bugs(plus its fixes).I would be totally unpolite if I send this list without mentioning from where it does come from. 2)Place. I could have contacted one by one each dev,but the silence in the channel,plus the time needed to find and push the bugs to them,plus the risk these "potential" fixes via PM drops in a darkhole pushed me to send it viaML or Bugzilla. Both of these options are crawled by Google,so both seems to be bad enough(from the dont-make-free-PR pov).But Bugzilla option is even worse:If I'd have decided for Bugzilla then I'd have ended creating 6 or 7 small reports. Much more references in Google ;). So I decided to send it via ML 3)Ros-dev ML. There are 3 potential MLs to send this report. In order of followers: Ros-general>Ros-Dev>Ros-priv From the dont-make-free-PR pov I could have choosen Ros-priv, but I thought this fits better in the Development ML.
In the same way I was the first saying his empathy and way of writting was bastardish, I am the first one of thanking this list of bugs and..fixes for the benefit of Reactos project.Vicmarcal may hate this guy,but Vicmarcal-PR-Team co-coordinator is a total different thing. I could explain in detail about these differences but in ros-priv ;)
Enviado desde mi iPhone
El 16/03/2012, a las 15:08, "Amine Khaldi" amine.khaldi@reactos.org escribió:
Hi Vic,
You know, sometimes I really don't understand your reasoning.
We decided that the guy is a bastard, and so even if we wanted to talk about his tool, we could do so on irc or something, not doing him even more free PR work through our ML, which will be all over google index.
Engaging in any relation with this guy is a slap to our face.
Cheers, Amine.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
On 16.03.2012 17:49, victor martinez wrote:
Example 4. ReactOS project. Incorrect calculation of a string length ( vbe.c 57 ) |static const PCHAR Nv11Board = "NV11 (GeForce2) Board"; static const PCHAR Nv11Chip = "Chip Rev B2"; static const PCHAR Nv11Vendor = "NVidia Corporation"; BOOLEAN IsVesaBiosOk(...) { ... if (!(strncmp(Vendor, Nv11Vendor, sizeof(Nv11Vendor)))&& !(strncmp(Product, Nv11Board, sizeof(Nv11Board)))&& !(strncmp(Revision, Nv11Chip, sizeof(Nv11Chip)))&& (OemRevision == 0x311)) ... }| Reason: The error here is this: the sizeof() operator, absolutely inappropriate in this situation, is used to calculate string lengths. The sizeof() operator actually calculates the pointer size instead of the number of bytes in a string.
In this case Abragin said this is not a bug.
I said it is, but you left IRC too early. Rafal really confirmed by testing.
[17:31] <@rafalh> abragin, vicmarcal sizeof returns 4 for me [17:32] <@abragin> then it should be defined as [17:32] <@rafalh> it would work for l static const CHAR Nv11Board[] [17:32] <@abragin> static const CHAR Nv11Board[] = "NV11 (GeForce2) Board"; [17:33] <@abragin> yeah
countof macro might be indicated
http://msdn.microsoft.com/en-us/library/ms175773%28v=vs.80%29.aspx
On Fri, Mar 16, 2012 at 12:27 PM, Aleksey Bragin aleksey@reactos.org wrote:
On 16.03.2012 17:49, victor martinez wrote:
Example 4. ReactOS project. Incorrect calculation of a string length ( vbe.c 57 )
static const PCHAR Nv11Board = "NV11 (GeForce2) Board"; static const PCHAR Nv11Chip = "Chip Rev B2"; static const PCHAR Nv11Vendor = "NVidia Corporation"; BOOLEAN IsVesaBiosOk(...) { ... if (!(strncmp(Vendor, Nv11Vendor, sizeof(Nv11Vendor))) && !(strncmp(Product, Nv11Board, sizeof(Nv11Board))) && !(strncmp(Revision, Nv11Chip, sizeof(Nv11Chip))) && (OemRevision == 0x311)) ... }
Reason: The error here is this: the sizeof() operator, absolutely inappropriate in this situation, is used to calculate string lengths. The sizeof() operator actually calculates the pointer size instead of the number of bytes in a string.
In this case Abragin said this is not a bug.
I said it is, but you left IRC too early. Rafal really confirmed by testing.
[17:31] <@rafalh> abragin, vicmarcal sizeof returns 4 for me [17:32] <@abragin> then it should be defined as [17:32] <@rafalh> it would work for l static const CHAR Nv11Board[] [17:32] <@abragin> static const CHAR Nv11Board[] = "NV11 (GeForce2) Board"; [17:33] <@abragin> yeah
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
A correct fix is to change
static const PCHAR Nv11Board = "NV11 (GeForce2) Board"; to static const CHAR Nv11Board[] = "NV11 (GeForce2) Board";
Also in that case the "const" would start to make sense.
Am 17.03.2012 01:14, schrieb Samuel Serapión:
countof macro might be indicated
http://msdn.microsoft.com/en-us/library/ms175773%28v=vs.80%29.aspx
On Fri, Mar 16, 2012 at 12:27 PM, Aleksey Braginaleksey@reactos.org wrote:
On 16.03.2012 17:49, victor martinez wrote:
Example 4. ReactOS project. Incorrect calculation of a string length ( vbe.c 57 )
static const PCHAR Nv11Board = "NV11 (GeForce2) Board"; static const PCHAR Nv11Chip = "Chip Rev B2"; static const PCHAR Nv11Vendor = "NVidia Corporation"; BOOLEAN IsVesaBiosOk(...) { ... if (!(strncmp(Vendor, Nv11Vendor, sizeof(Nv11Vendor)))&& !(strncmp(Product, Nv11Board, sizeof(Nv11Board)))&& !(strncmp(Revision, Nv11Chip, sizeof(Nv11Chip)))&& (OemRevision == 0x311)) ... }
Reason: The error here is this: the sizeof() operator, absolutely inappropriate in this situation, is used to calculate string lengths. The sizeof() operator actually calculates the pointer size instead of the number of bytes in a string.
In this case Abragin said this is not a bug.
I said it is, but you left IRC too early. Rafal really confirmed by testing.
[17:31]<@rafalh> abragin, vicmarcal sizeof returns 4 for me [17:32]<@abragin> then it should be defined as [17:32]<@rafalh> it would work for l static const CHAR Nv11Board[] [17:32]<@abragin> static const CHAR Nv11Board[] = "NV11 (GeForce2) Board"; [17:33]<@abragin> yeah
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev