Skip to content

Commit 1a4778f

Browse files
committed
LIB: sm_try_atoi: always initialize output integer, just in case
Signed-off-by: Stefan Westerfeld <[email protected]>
1 parent d8a81af commit 1a4778f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/smutils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ dir_exists (const string& dirname)
578578
bool
579579
sm_try_atoi (const char *str, int& i)
580580
{
581+
i = 0;
582+
581583
if (!str || *str == '\0')
582584
return false;
583585

0 commit comments

Comments
 (0)