After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762202 - g_win32_error_message improvements
g_win32_error_message improvements
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-02-17 17:32 UTC by Marc-Andre Lureau
Modified: 2016-03-15 10:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
win32: fix off-by-one length check (1.21 KB, patch)
2016-02-17 17:32 UTC, Marc-Andre Lureau
committed Details | Review
win32: use wcslen() return type (852 bytes, patch)
2016-02-17 17:32 UTC, Marc-Andre Lureau
committed Details | Review
win32: fix indentation (1003 bytes, patch)
2016-02-17 17:32 UTC, Marc-Andre Lureau
committed Details | Review
win32: use wide-char for constants (1.06 KB, patch)
2016-02-17 17:32 UTC, Marc-Andre Lureau
committed Details | Review
win32: use wide-char for constants (1.06 KB, patch)
2016-03-15 10:37 UTC, Marc-Andre Lureau
committed Details | Review
win32: fix indentation (1003 bytes, patch)
2016-03-15 10:37 UTC, Marc-Andre Lureau
committed Details | Review
win32: use wcslen() return type (852 bytes, patch)
2016-03-15 10:37 UTC, Marc-Andre Lureau
committed Details | Review
win32: fix off-by-one length check (1.21 KB, patch)
2016-03-15 10:37 UTC, Marc-Andre Lureau
committed Details | Review

Description Marc-Andre Lureau 2016-02-17 17:32:25 UTC
Small patches improving  g_win32_error_message()
Comment 1 Marc-Andre Lureau 2016-02-17 17:32:29 UTC
Created attachment 321520 [details] [review]
win32: fix off-by-one length check

Laszlo Ersek said: "The length check is off by one (in the safe direction); it
should be (nchars >= 2). The processing should be active for the wide string
L"\r\n" -- resulting in the empty wide string --, I believe."

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 2 Marc-Andre Lureau 2016-02-17 17:32:35 UTC
Created attachment 321521 [details] [review]
win32: use wcslen() return type

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 3 Marc-Andre Lureau 2016-02-17 17:32:41 UTC
Created attachment 321522 [details] [review]
win32: fix indentation

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 4 Marc-Andre Lureau 2016-02-17 17:32:46 UTC
Created attachment 321523 [details] [review]
win32: use wide-char for constants

Use the appropriate type for comparisons and assignment of wide chars.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 5 Matthias Clasen 2016-02-18 04:10:24 UTC
Review of attachment 321520 [details] [review]:

ok
Comment 6 Matthias Clasen 2016-02-18 04:10:45 UTC
Review of attachment 321521 [details] [review]:

sure
Comment 7 Matthias Clasen 2016-02-18 04:11:20 UTC
Review of attachment 321522 [details] [review]:

ok
Comment 8 Matthias Clasen 2016-02-18 04:11:55 UTC
Review of attachment 321523 [details] [review]:

ok
Comment 9 Marc-Andre Lureau 2016-03-15 10:37:10 UTC
The following fixes have been pushed:
37ebc83 win32: use wide-char for constants
6227486 win32: fix indentation
5be8cab win32: use wcslen() return type
a1bcd1e win32: fix off-by-one length check
Comment 10 Marc-Andre Lureau 2016-03-15 10:37:32 UTC
Created attachment 323957 [details] [review]
win32: use wide-char for constants

Use the appropriate type for comparisons and assignment of wide chars.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 11 Marc-Andre Lureau 2016-03-15 10:37:38 UTC
Created attachment 323958 [details] [review]
win32: fix indentation

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 12 Marc-Andre Lureau 2016-03-15 10:37:44 UTC
Created attachment 323959 [details] [review]
win32: use wcslen() return type

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Comment 13 Marc-Andre Lureau 2016-03-15 10:37:50 UTC
Created attachment 323960 [details] [review]
win32: fix off-by-one length check

Laszlo Ersek said: "The length check is off by one (in the safe direction); it
should be (nchars >= 2). The processing should be active for the wide string
L"\r\n" -- resulting in the empty wide string --, I believe."

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>