aboutsummaryrefslogtreecommitdiffstats
path: root/src/routines.c
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-08-25 19:38:00 +0300
committerJoursoir <chat@joursoir.net>2022-08-25 20:36:12 +0300
commit95705e381b2256df902ae36f64167b882dba7548 (patch)
treeb2b98c404e66ebd76c5ca22e5f8c5be298631f8a /src/routines.c
parente0810c5c7ae73c5e12d20fb169507e121c6b01e1 (diff)
downloadlock-password-95705e381b2256df902ae36f64167b882dba7548.tar.gz
lock-password-95705e381b2256df902ae36f64167b882dba7548.tar.bz2
lock-password-95705e381b2256df902ae36f64167b882dba7548.zip
tree: move printing error into check_sneaky_paths()
Avoid repeating the same error messages.
Diffstat (limited to 'src/routines.c')
-rw-r--r--src/routines.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/routines.c b/src/routines.c
index 09916aa..21c569b 100644
--- a/src/routines.c
+++ b/src/routines.c
@@ -33,6 +33,7 @@
#if defined(DISPLAY)
#include "r-x11.h"
#endif
+#include "output.h"
#define NUMBER_ALLOWED_CHARS (10+26+26+8)
@@ -72,8 +73,10 @@ int check_sneaky_paths(const char *path)
int length = strlen(path), i;
for(i = 1; i < length; i++)
{
- if(path[i-1] == '.' && path[i] == '.')
+ if(path[i-1] == '.' && path[i] == '.') {
+ print_error("Error: You have used forbidden paths\n");
return 1;
+ }
}
return 0;
}