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
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
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 | 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 | while (length && isspace(message[length - 1]) --length; this one is a bit more safer |