mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-31 18:38:00 +02:00
lint(format): change format rules a bit
This commit is contained in:
15
src/auth.c
15
src/auth.c
@@ -15,10 +15,8 @@
|
||||
#include "unistd.h"
|
||||
#include "util.h"
|
||||
|
||||
int pam_conversation(int num_msg,
|
||||
const struct pam_message** msg,
|
||||
struct pam_response** resp,
|
||||
void* appdata_ptr) {
|
||||
int pam_conversation(int num_msg, const struct pam_message** msg,
|
||||
struct pam_response** resp, void* appdata_ptr) {
|
||||
struct pam_response* reply =
|
||||
(struct pam_response*)malloc(sizeof(struct pam_response) * num_msg);
|
||||
for (size_t i = 0; i < num_msg; i++) {
|
||||
@@ -95,9 +93,7 @@ void sourceFileTry(char* file) {
|
||||
(void)fclose(file2source);
|
||||
}
|
||||
|
||||
void moarEnv(char* user,
|
||||
struct session session,
|
||||
struct passwd* pw,
|
||||
void moarEnv(char* user, struct session session, struct passwd* pw,
|
||||
struct behavior* behavior) {
|
||||
if (chdir(pw->pw_dir) == -1) print_errno("can't chdir to user home");
|
||||
|
||||
@@ -153,10 +149,7 @@ void moarEnv(char* user,
|
||||
}
|
||||
|
||||
// NOLINTBEGIN(readability-function-cognitive-complexity)
|
||||
bool launch(char* user,
|
||||
char* passwd,
|
||||
struct session session,
|
||||
void (*cb)(void),
|
||||
bool launch(char* user, char* passwd, struct session session, void (*cb)(void),
|
||||
struct behavior* behavior) {
|
||||
struct passwd* pw = getpwnam(user);
|
||||
if (pw == NULL) {
|
||||
|
@@ -52,8 +52,8 @@ int read_desktop(FILE* fd, void* ctx,
|
||||
// Key & Value
|
||||
char* key = buf;
|
||||
buf[eq_idx] = '\0'; // the equal
|
||||
char* value = &buf[eq_idx+1];
|
||||
buf[read_size-1] = '\0'; // the newline
|
||||
char* value = &buf[eq_idx + 1];
|
||||
buf[read_size - 1] = '\0'; // the newline
|
||||
|
||||
// Callback
|
||||
struct status cb_ret = cb(ctx, table_name, key, value);
|
||||
|
6
src/ui.c
6
src/ui.c
@@ -419,8 +419,7 @@ static void clean_line(struct uint_point origin, uint line) {
|
||||
}
|
||||
|
||||
// TODO: session_len > 32
|
||||
static void print_session(struct uint_point origin,
|
||||
struct session session,
|
||||
static void print_session(struct uint_point origin, struct session session,
|
||||
bool multiple) {
|
||||
clean_line(origin, 5);
|
||||
const char* session_type;
|
||||
@@ -454,8 +453,7 @@ static void print_session(struct uint_point origin,
|
||||
}
|
||||
|
||||
// TODO: user_len > 32
|
||||
static void print_user(struct uint_point origin,
|
||||
struct user user,
|
||||
static void print_user(struct uint_point origin, struct user user,
|
||||
bool multiple) {
|
||||
clean_line(origin, 7);
|
||||
printf("\r\x1b[%luC\x1b[%sm%s\x1b[%sm",
|
||||
|
Reference in New Issue
Block a user