"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/modules/login.c" between
userinfo-2.4.tar.gz and userinfo-2.5.tar.gz

About: userinfo is a console utility to display a variety of information about a local user.

login.c  (userinfo-2.4):login.c  (userinfo-2.5)
/* /*
Copyright (C) 2001-2013 Ben Kibbey <bjk@luxsci.net> Copyright (C) 2001-2015 Ben Kibbey <bjk@luxsci.net>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
skipping to change at line 95 skipping to change at line 95
#endif #endif
#if (!defined(__FreeBSD_version) || __FreeBSD_version < 900000) #if (!defined(__FreeBSD_version) || __FreeBSD_version < 900000)
if (lastlogfd) if (lastlogfd)
close(lastlogfd); close(lastlogfd);
#endif #endif
} }
static void free_logins(UTMP **u) static void free_logins(UTMP **u)
{ {
if (!u)
return;
if (login_count) { if (login_count) {
UTMP **up; UTMP **up;
for (up = u; *up; up++) for (up = u; *up; up++)
free(*up); free(*up);
free(u); free(u);
} }
} }
skipping to change at line 732 skipping to change at line 735
} }
if (line[0] == '\0') if (line[0] == '\0')
strncpy(line, "!", sizeof(line)); strncpy(line, "!", sizeof(line));
else else
line[strlen(line) - 1] = '\0'; line[strlen(line) - 1] = '\0';
add_string(&strings, line); add_string(&strings, line);
break; break;
case 'm': case 'm':
add_string(&strings, msgstat(u, multi)); add_string(&strings, u ? msgstat(u, multi) : "!");
break; break;
case 't': case 't':
for (i = 0; i < login_count; i++) { for (i = 0; i < login_count; i++) {
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
safe_strncat(line, stamp(u[i]->ut_tv.tv_sec, tf), sizeof(line )); safe_strncat(line, stamp(u[i]->ut_tv.tv_sec, tf), sizeof(line ));
#else #else
safe_strncat(line, stamp(u[i]->ut_time, tf), sizeof(line)); safe_strncat(line, stamp(u[i]->ut_time, tf), sizeof(line));
#endif #endif
safe_strncat(line, m, sizeof(line)); safe_strncat(line, m, sizeof(line));
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS