diff --git a/src/disp.c b/src/disp.c index 7623d1a..5ecfd3e 100644 --- a/src/disp.c +++ b/src/disp.c @@ -795,7 +795,7 @@ void main_ascii_output(char *data[], char *data_names[]) } else { - ERROR_OUT("Error: ", "Could not find a logo for the distro."); + ERR_REPORT("Could not find a logo for the distro."); } return; diff --git a/src/disp.h b/src/disp.h index 3e06818..db21dd6 100644 --- a/src/disp.h +++ b/src/disp.h @@ -19,7 +19,7 @@ void output_logo_only(char *distro); void main_ascii_output(char *data[], char *data_names[]); void main_text_output(char *data[], char *data_names[]); -#define ERROR_OUT(str1, str2) (fprintf(stderr, TWHT "[[ " TLRD "!" TWHT " ]] " TNRM "%s%s\n", str1, str2)) +#define ERR_REPORT(str) (fprintf(stderr, TWHT "[[ " TLRD "!" TWHT " ]] " TNRM "Error: %s\n", str)) #define VERBOSE_OUT(str1, str2) (fprintf(stdout, TLRD ":: " TNRM "%s%s\n", str1, str2)) #endif /* SCREENFETCH_C_DISP_H */ diff --git a/src/plat/bsd/detect.c b/src/plat/bsd/detect.c index e639b80..65c8ee2 100644 --- a/src/plat/bsd/detect.c +++ b/src/plat/bsd/detect.c @@ -167,7 +167,7 @@ void detect_pkgs(char *str, const char *distro_str) safe_strncpy(str, "Not Found", MAX_STRLEN); if (error) - ERROR_OUT("Error: ", "Could not find packages on current OS."); + ERR_REPORT("Could not find packages on current OS."); #endif snprintf(str, MAX_STRLEN, "%d", packages); @@ -233,7 +233,7 @@ void detect_disk(char *str) } else if (error) { - ERROR_OUT("Error: ", "Could not stat $HOME for filesystem statistics."); + ERR_REPORT("Could not stat $HOME for filesystem statistics."); } return; @@ -279,7 +279,7 @@ void detect_shell(char *str) if (shell_name == NULL) { if (error) - ERROR_OUT("Error: ", "Could not detect a shell."); + ERR_REPORT("Could not detect a shell."); return; } @@ -382,7 +382,7 @@ void detect_de(char *str) } else if (error) { - ERROR_OUT("Error: ", "No desktop environment found."); + ERR_REPORT("No desktop environment found."); } } diff --git a/src/plat/darwin/detect.c b/src/plat/darwin/detect.c index fb958eb..c9ccf85 100644 --- a/src/plat/darwin/detect.c +++ b/src/plat/darwin/detect.c @@ -162,7 +162,7 @@ void detect_pkgs(char *str, const char *distro_str) } else if (error) { - ERROR_OUT("Error: ", "Failure while globbing packages."); + ERR_REPORT("Failure while globbing packages."); } globfree(&gl); @@ -231,7 +231,7 @@ void detect_disk(char *str) } else if (error) { - + ERR_REPORT("Could not stat $HOME for filesystem statistics."); } return; @@ -288,7 +288,7 @@ void detect_shell(char *str) if (shell_name == NULL) { if (error) - ERROR_OUT("Error: ", "Could not detect a shell."); + ERR_REPORT("Could not detect a shell."); return; } diff --git a/src/plat/linux/detect.c b/src/plat/linux/detect.c index b8b207d..92fb0b3 100644 --- a/src/plat/linux/detect.c +++ b/src/plat/linux/detect.c @@ -131,7 +131,7 @@ void detect_distro(char *str) Until then, spit out an error message. */ if (error) - ERROR_OUT("Error: ", "Failed to detect a Linux distro."); + ERR_REPORT("Failed to detect a Linux distro."); } else { @@ -139,7 +139,7 @@ void detect_distro(char *str) if (error) { - ERROR_OUT("Error: ", "Failed to detect a Linux distro."); + ERR_REPORT("Failed to detect a Linux distro."); } } } @@ -179,7 +179,7 @@ void detect_host(char *str) } else if (error) { - ERROR_OUT("Error: ", "Could not detetct username."); + ERR_REPORT("Could not detetct username."); } uname(&host_info); @@ -247,7 +247,7 @@ void detect_pkgs(char *str, const char *distro_str) } else if (error) { - ERROR_OUT("Error: ", "Failure while globbing packages."); + ERR_REPORT("Failure while globbing packages."); } globfree(&gl); @@ -283,7 +283,7 @@ void detect_pkgs(char *str, const char *distro_str) } else if (error) { - ERROR_OUT("Error: ", "Failure while globbing packages."); + ERR_REPORT("Failure while globbing packages."); } globfree(&gl); @@ -321,8 +321,8 @@ void detect_pkgs(char *str, const char *distro_str) safe_strncpy(str, "Not Found", MAX_STRLEN); if (error) - ERROR_OUT("Error: ", "Packages cannot be detected on an unknown " - "Linux distro."); + ERR_REPORT("Packages cannot be detected on an unknown " + "Linux distro."); } snprintf(str, MAX_STRLEN, "%d", packages); @@ -380,14 +380,14 @@ void detect_gpu(char *str) } else if (error) { - ERROR_OUT("Error: ", "Failed to create OpenGL context."); + ERR_REPORT("Failed to create OpenGL context."); } XFree((void *) visual_info); } else if (error) { - ERROR_OUT("Error: ", "Failed to select a proper X visual."); + ERR_REPORT("Failed to select a proper X visual."); } XCloseDisplay(disp); @@ -395,7 +395,7 @@ void detect_gpu(char *str) else if (error) { safe_strncpy(str, "No X Server", MAX_STRLEN); - ERROR_OUT("Error: ", "Could not open an X display."); + ERR_REPORT("Could not open an X display."); } return; @@ -419,7 +419,7 @@ void detect_disk(char *str) } else if (error) { - ERROR_OUT("Error: ", "Could not stat $HOME for filesystem statistics."); + ERR_REPORT("Could not stat $HOME for filesystem statistics."); } return; @@ -470,7 +470,7 @@ void detect_shell(char *str) if (shell_name == NULL) { if (error) - ERROR_OUT("Error: ", "Could not detect a shell."); + ERR_REPORT("Could not detect a shell."); return; } @@ -543,7 +543,7 @@ void detect_res(char *str) safe_strncpy(str, "No X Server", MAX_STRLEN); if (error) - ERROR_OUT("Error: ", "Problem detecting X display resolution."); + ERR_REPORT("Problem detecting X display resolution."); } return; @@ -580,7 +580,7 @@ void detect_de(char *str) } else if (error) { - ERROR_OUT("Error: ", "No desktop environment found."); + ERR_REPORT("No desktop environment found."); } } @@ -618,21 +618,21 @@ void detect_wm(char *str) } else if (error) { - ERROR_OUT("Error: ", "No _NET_WM_NAME property found."); + ERR_REPORT("No _NET_WM_NAME property found."); } XFree(wm_check_window); } else if (error) { - ERROR_OUT("Error: ", "No WM detected (non-EWMH compliant?)"); + ERR_REPORT("No WM detected (non-EWMH compliant?)"); } XCloseDisplay(disp); } else if (error) { - ERROR_OUT("Error: ", "Could not open an X display."); + ERR_REPORT("Could not open an X display."); } return; diff --git a/src/plat/sun/detect.c b/src/plat/sun/detect.c index 24c0361..33d49bd 100644 --- a/src/plat/sun/detect.c +++ b/src/plat/sun/detect.c @@ -192,7 +192,7 @@ void detect_disk(char *str) } else if (error) { - ERROR_OUT("Error: ", "Could not stat $HOME for filesystem statistics."); + ERR_REPORT("Could not stat $HOME for filesystem statistics."); } return; @@ -236,7 +236,7 @@ void detect_shell(char *str) if (shell_name == NULL) { if (error) - ERROR_OUT("Error: ", "Could not detect a shell."); + ERR_REPORT("Could not detect a shell."); return; } @@ -306,7 +306,7 @@ void detect_res(char *str) safe_strncpy(str, "No X Server", MAX_STRLEN); if (error) - ERROR_OUT("Error: ", "Problem detecting X display resolution."); + ERR_REPORT("Problem detecting X display resolution."); } XCloseDisplay(disp); @@ -345,7 +345,7 @@ void detect_de(char *str) } else if (error) { - ERROR_OUT("Error: ", "No desktop environment found."); + ERR_REPORT("No desktop environment found."); } } @@ -387,21 +387,21 @@ void detect_wm(char *str) } else if (error) { - ERROR_OUT("Error: ", "No _NET_WM_NAME property found."); + ERR_REPORT("No _NET_WM_NAME property found."); } XFree(wm_check_window); } else if (error) { - ERROR_OUT("Error: ", "WM cannot be detected without EWMH compliance."); + ERR_REPORT("WM cannot be detected without EWMH compliance."); } XCloseDisplay(disp); } else if (error) { - ERROR_OUT("Error: ", "Could not open an X display."); + ERR_REPORT("Could not open an X display."); } return; diff --git a/src/plat/win32/detect.c b/src/plat/win32/detect.c index e2c3b43..0d53885 100644 --- a/src/plat/win32/detect.c +++ b/src/plat/win32/detect.c @@ -102,7 +102,7 @@ void detect_host(char *str) given_user = malloc(sizeof(char) * MAX_STRLEN); if (!given_user) { - ERROR_OUT("Error: ", "Memory allocation failed in detect_host."); + ERR_REPORT("Memory allocation failed in detect_host."); exit(1); } @@ -297,7 +297,7 @@ void detect_shell(char *str) if (shell_name == NULL) { if (error) - ERROR_OUT("Error: ", "Could not detect a shell."); + ERR_REPORT("Could not detect a shell."); return; } diff --git a/src/util.c b/src/util.c index 5eb8e80..be41e1c 100644 --- a/src/util.c +++ b/src/util.c @@ -111,7 +111,7 @@ void take_screenshot(bool verbose) } else if (call_status && error) { - ERROR_OUT("Error: ", "Problem saving screenshot."); + ERR_REPORT("Problem saving screenshot."); } #endif