Re: [PATCH weston] backends: don't run off the end of strings

2014-10-23 Thread Derek Foreman
Fair enough. The patch is useless. :) Thanks On 23/10/14 01:43 PM, Bill Spitzak wrote: > That won't run off the end of a zero or one-length string. > > If strlen() works then there is a nul byte there. The first test against > 'W' will fail because 0 != 'W', and the second test will not be run.

Re: [PATCH weston] backends: don't run off the end of strings

2014-10-23 Thread Bill Spitzak
That won't run off the end of a zero or one-length string. If strlen() works then there is a nul byte there. The first test against 'W' will fail because 0 != 'W', and the second test will not be run. On 10/23/2014 10:21 AM, Derek Foreman wrote: Strings from the config parser can be of length

[PATCH weston] backends: don't run off the end of strings

2014-10-23 Thread Derek Foreman
Strings from the config parser can be of length 0, so we should check that before checking the string's bytes. The x11 backend's usage is technically safe since the null terminator is present, but I've changed it too in case someone's looking at it as a reference for new code. --- src/compositor-