Don't include the \n at the end of the debug messages
Details
Details
Now I can see the debug errors without an empty line below
Diff Detail
Diff Detail
- Repository
- R108 KWin
- Branch
- arcpatch-D29684
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 26918 Build 26936: arc lint + arc unit
plugins/scenes/opengl/scene_opengl.cpp | ||
---|---|---|
421 | Noob question: what is going to happen if length is 0? |
Comment Actions
I'm expecting QDebug would handle it, I don't see why opengl would be giving us an empty debug message though.
plugins/scenes/opengl/scene_opengl.cpp | ||
---|---|---|
414–416 | Hmm, why doesn't this code work? |
plugins/scenes/opengl/scene_opengl.cpp | ||
---|---|---|
414–416 | It's quite possible that we have an off by one error here. |
plugins/scenes/opengl/scene_opengl.cpp | ||
---|---|---|
414 ↗ | (On Diff #82869) | while (message[length] == '\0') length--; will cutoff the last character, e.g. if we have "abcd\0" then only "abc" will be printed. More conservative trimming algorithm will look something like this while (message[length - 1] == '\n' || message[length - 1] == '\r') --length; |
plugins/scenes/opengl/scene_opengl.cpp | ||
---|---|---|
414 ↗ | (On Diff #82869) | while (length && isspace(message[length - 1]) --length; this one is a bit more safer |