mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 08:18:02 +02:00
util: fix indentation for safe_atoi
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3168d86223)
This commit is contained in:
parent
a9dad56948
commit
67a875d752
1 changed files with 11 additions and 11 deletions
|
|
@ -407,20 +407,20 @@ us2ms(uint64_t us)
|
||||||
static inline bool
|
static inline bool
|
||||||
safe_atoi(const char *str, int *val)
|
safe_atoi(const char *str, int *val)
|
||||||
{
|
{
|
||||||
char *endptr;
|
char *endptr;
|
||||||
long v;
|
long v;
|
||||||
|
|
||||||
v = strtol(str, &endptr, 10);
|
v = strtol(str, &endptr, 10);
|
||||||
if (str == endptr)
|
if (str == endptr)
|
||||||
return false;
|
return false;
|
||||||
if (*str != '\0' && *endptr != '\0')
|
if (*str != '\0' && *endptr != '\0')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (v > INT_MAX || v < INT_MIN)
|
if (v > INT_MAX || v < INT_MIN)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*val = v;
|
*val = v;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LIBINPUT_UTIL_H */
|
#endif /* LIBINPUT_UTIL_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue