Fri May 24 17:30:50 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
authorroland <roland>
Fri, 24 May 1996 21:41:49 +0000 (21:41 +0000)
committerroland <roland>
Fri, 24 May 1996 21:41:49 +0000 (21:41 +0000)
* login/getutline_r.c: Use strncmp instead of comparing two pointers
that will only be equal if you are overwriting the data and screwing
yourself anyway.

login/getutline_r.c

index 62c8c2f..84c77cb 100644 (file)
@@ -53,7 +53,8 @@ getutline_r (const struct utmp *line, struct utmp **utmp,
       /* Update position pointer.  */
       utmp_data->loc_utmp += sizeof (struct utmp);
     }
-  while (line->ut_line != utmp_data->ubuf.ut_line);
+  while (strncmp (line->ut_line, utmp_data->ubuf.ut_line,
+                 sizeof line->ut_line));
 
   *utmp = &utmp_data->ubuf;