| 1 |
Description: fix gcc warnings |
| 2 |
Use NULL where it helps the compiler, and eliminate unnecessary gcc-isms. |
| 3 |
Author: Thomas E. Dickey <[email protected]> |
| 4 |
Origin: other |
| 5 |
Applied-Upstream: not-needed |
| 6 |
Last-Update: 2026-02-08 |
| 7 |
|
| 8 |
--- libutempter-1.2.1.orig/iface.c |
| 9 |
+++ libutempter-1.2.1/iface.c |
| 10 |
@@ -110,7 +110,7 @@ execute_helper(int master_fd, const char |
| 11 |
} |
| 12 |
|
| 13 |
ret: |
| 14 |
- (void) sigaction(SIGCHLD, &saved_action, 0); |
| 15 |
+ (void) sigaction(SIGCHLD, &saved_action, NULL); |
| 16 |
return !status; |
| 17 |
} |
| 18 |
} |
| 19 |
@@ -121,10 +121,10 @@ int |
| 20 |
utempter_add_record(int master_fd, const char *hostname) |
| 21 |
{ |
| 22 |
const char *const args[] = { |
| 23 |
- utempter_pathname ? : UTEMPTER_DEFAULT_PATHNAME, |
| 24 |
+ utempter_pathname ? utempter_pathname : UTEMPTER_DEFAULT_PATHNAME, |
| 25 |
"add", |
| 26 |
hostname, |
| 27 |
- 0 |
| 28 |
+ NULL |
| 29 |
}; |
| 30 |
int status = execute_helper(master_fd, args); |
| 31 |
|
| 32 |
@@ -138,9 +138,9 @@ int |
| 33 |
utempter_remove_record(int master_fd) |
| 34 |
{ |
| 35 |
const char *const args[] = { |
| 36 |
- utempter_pathname ? : UTEMPTER_DEFAULT_PATHNAME, |
| 37 |
+ utempter_pathname ? utempter_pathname : UTEMPTER_DEFAULT_PATHNAME, |
| 38 |
"del", |
| 39 |
- 0 |
| 40 |
+ NULL |
| 41 |
}; |
| 42 |
int status = execute_helper(master_fd, args); |
| 43 |
|
| 44 |
--- libutempter-1.2.1.orig/utempter.c |
| 45 |
+++ libutempter-1.2.1/utempter.c |
| 46 |
@@ -86,7 +86,7 @@ write_uwtmp_record(const char *user, con |
| 47 |
memset(&ut, 0, sizeof(ut)); |
| 48 |
|
| 49 |
memset(&tv, 0, sizeof(tv)); |
| 50 |
- (void) gettimeofday(&tv, 0); |
| 51 |
+ (void) gettimeofday(&tv, NULL); |
| 52 |
|
| 53 |
len = strlen(user); |
| 54 |
memcpy(ut.ut_name, user, MIN(sizeof(ut.ut_name), len)); |