mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 06:06:57 +00:00
string_utils: fix integer comparisons
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
02d477ccc6
commit
a5e92f5dff
@ -1000,10 +1000,9 @@ char *lxc_trim_whitespace_in_place(char *buffer)
|
|||||||
|
|
||||||
int lxc_is_line_empty(const char *line)
|
int lxc_is_line_empty(const char *line)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
size_t len = strlen(line);
|
size_t len = strlen(line);
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (size_t i = 0; i < len; i++)
|
||||||
if (line[i] != ' ' && line[i] != '\t' &&
|
if (line[i] != ' ' && line[i] != '\t' &&
|
||||||
line[i] != '\n' && line[i] != '\r' &&
|
line[i] != '\n' && line[i] != '\r' &&
|
||||||
line[i] != '\f' && line[i] != '\0')
|
line[i] != '\f' && line[i] != '\0')
|
||||||
|
@ -155,7 +155,7 @@ static inline char *deabs(char *str)
|
|||||||
({ \
|
({ \
|
||||||
int __ret_strnprintf; \
|
int __ret_strnprintf; \
|
||||||
__ret_strnprintf = snprintf(buf, buf_size, ##__VA_ARGS__); \
|
__ret_strnprintf = snprintf(buf, buf_size, ##__VA_ARGS__); \
|
||||||
if (__ret_strnprintf < 0 || (size_t)__ret_strnprintf >= buf_size) \
|
if (__ret_strnprintf < 0 || (size_t)__ret_strnprintf >= (size_t)buf_size) \
|
||||||
__ret_strnprintf = ret_errno(EIO); \
|
__ret_strnprintf = ret_errno(EIO); \
|
||||||
__ret_strnprintf; \
|
__ret_strnprintf; \
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user