Merge pull request 'Warnings fixes' (#37) from YanTheKaller/libublsettings:master into master

Reviewed-on: #37
master v1.33
Dmitry Razumov 1 year ago
commit 7556483b80

@ -905,7 +905,7 @@ char *yon_ubl_root_user_get(){
FILE *file = popen("getent passwd $PKEXEC_UID | cut -d: -f1","r"); FILE *file = popen("getent passwd $PKEXEC_UID | cut -d: -f1","r");
user=malloc(4096); user=malloc(4096);
memset(user,0,4096); memset(user,0,4096);
fgets(user,4096,file); if (fgets(user,4096,file)){};
user=yon_char_divide_search(user,"\n",-1); user=yon_char_divide_search(user,"\n",-1);
fclose(file); fclose(file);
if (user) return user; if (user) return user;
@ -918,7 +918,7 @@ char *yon_ubl_user_get_home_directory(){
FILE *path = popen(get_home_dir_command,"r"); FILE *path = popen(get_home_dir_command,"r");
char *ret = malloc(4096); char *ret = malloc(4096);
memset(ret,0,4096); memset(ret,0,4096);
fgets(ret,4096,path); if (fgets(ret,4096,path)){};
ret=yon_char_divide_search(ret,"\n",-1); ret=yon_char_divide_search(ret,"\n",-1);
fclose(path); fclose(path);
return ret; return ret;
@ -2242,7 +2242,7 @@ config_str yon_file_open(char *file_path, int *size){
int yon_file_save(char *file_path, char *text){ int yon_file_save(char *file_path, char *text){
FILE *file = fopen(file_path,"w"); FILE *file = fopen(file_path,"w");
struct passwd *user = getpwnam(yon_ubl_root_user_get()); struct passwd *user = getpwnam(yon_ubl_root_user_get());
chown(file_path,user->pw_uid,user->pw_gid); if (chown(file_path,user->pw_uid,user->pw_gid)){};
chmod(file_path,0644); chmod(file_path,0644);
if (file){ if (file){
fputs(text,file); fputs(text,file);
@ -2259,7 +2259,7 @@ int yon_file_create(char *path, char *name, int rules){
FILE *fl = fopen(full_path,"w"); FILE *fl = fopen(full_path,"w");
if (fl){ if (fl){
struct passwd *user = getpwnam(yon_ubl_root_user_get()); struct passwd *user = getpwnam(yon_ubl_root_user_get());
chown(path,user->pw_uid,user->pw_gid); if (chown(path,user->pw_uid,user->pw_gid)){};
chmod(full_path,rules); chmod(full_path,rules);
fclose(fl); fclose(fl);
return 1; return 1;

Loading…
Cancel
Save