mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
Fix comparison between two character arrays
Hello, The member 'id' in the 'utmp' struct is not a numeric but a character array, hence the strncmp() function is needed to compare two members.
This commit is contained in:
parent
7e09931ad9
commit
613a7f9036
@ -63,7 +63,7 @@ getutid (struct utmp *id)
|
||||
case LOGIN_PROCESS:
|
||||
case USER_PROCESS:
|
||||
case DEAD_PROCESS:
|
||||
if (id->ut_id == utmp_data.ut_id)
|
||||
if (!strncmp (id->ut_id, utmp_data.ut_id, sizeof (utmp_data.ut_id)))
|
||||
return &utmp_data;
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user