#include "shadowlog.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
+#include "string/strcmp/strneq.h"
#include "string/strcmp/strprefix.h"
if (utent->ut_type != USER_PROCESS) {
continue;
}
- if (strncmp (utent->ut_user, name, sizeof utent->ut_user) != 0) {
+ if (!STRNEQ(utent->ut_user, name))
continue;
- }
+
if (kill (utent->ut_pid, 0) != 0) {
continue;
}
#include "sizeof.h"
#include "string/strchr/strnul.h"
#include "string/strcmp/streq.h"
+#include "string/strcmp/strneq.h"
#include "string/strcmp/strprefix.h"
#include "string/strcpy/strncpy.h"
#include "string/strcpy/strtcpy.h"
ut = get_current_utmp(main_pid);
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
- if ((ut != NULL) && strncmp(ut->ut_host, "", countof(ut->ut_host)) != 0) {
+ if ((ut != NULL) && !STRNEQ(ut->ut_host, "")) {
*out = XSTRNDUP(ut->ut_host);
} else {
*out = NULL;
if (NULL != host && !streq(host, ""))
hostname = xstrdup(host);
#if defined(HAVE_STRUCT_UTMPX_UT_HOST)
- else if (NULL != ut && strncmp(ut->ut_host, "", countof(ut->ut_host)) != 0)
+ else if (NULL != ut && !STRNEQ(ut->ut_host, ""))
hostname = XSTRNDUP(ut->ut_host);
#endif
if (USER_PROCESS != ut->ut_type) {
continue;
}
- if (strncmp(ut->ut_user, "", countof(ut->ut_user)) == 0)
+ if (STRNEQ(ut->ut_user, ""))
continue;
- if (strncmp(ut->ut_user, name, countof(ut->ut_user)) != 0)
+ if (!STRNEQ(ut->ut_user, name))
continue;
count++;
#include "string/memset/memzero.h"
#include "string/sprintf/snprintf.h"
#include "string/strcmp/streq.h"
+#include "string/strcmp/strneq.h"
#include "string/strcmp/strprefix.h"
#include "string/strcpy/strtcpy.h"
#include "string/strdup/xstrdup.h"
printf (_("Last login: %s on %s"),
ptime, ll.ll_line);
#ifdef HAVE_LL_HOST /* __linux__ || SUN4 */
- if (strncmp(ll.ll_host, "", countof(ll.ll_host)) != 0) {
+ if (!STRNEQ(ll.ll_host, "")) {
printf (_(" from %.*s"),
(int) sizeof ll.ll_host, ll.ll_host);
}
#include "prototypes.h"
#include "shadowlog.h"
#include "sizeof.h"
+#include "string/strcmp/strneq.h"
#include "string/strcpy/strncat.h"
#include "string/strdup/strndupa.h"
if (ut->ut_type != USER_PROCESS) {
continue;
}
- if (strncmp(ut->ut_user, "", countof(ut->ut_user)) == 0)
+ if (STRNEQ(ut->ut_user, ""))
continue;
if (check_login (ut)) {