]> git.lizzy.rs Git - bspwm.git/blobdiff - bspc.c
Four hyphens is enough
[bspwm.git] / bspc.c
diff --git a/bspc.c b/bspc.c
index e0f88071768b5d509b6f98ef5a7eb3ea0df1bd87..ee6432d523c2337a1d9cf56e37f0956be2965b5f 100644 (file)
--- a/bspc.c
+++ b/bspc.c
@@ -15,13 +15,13 @@ int main(int argc, char *argv[])
     char rsp[BUFSIZ];
 
     if (argc < 2)
-        err("no arguments given\n");
+        err("No arguments given.\n");
 
     char *sock_path = getenv(SOCKET_ENV_VAR);
     if (sock_path == NULL || strlen(sock_path) == 0)
-        warn("environmental variable '%s' is not set or empty - using default value: %s\n", SOCKET_ENV_VAR, DEFAULT_SOCKET_PATH);
+        warn("The environment variable '%s' is not set or empty, we will use: '%s'.\n", SOCKET_ENV_VAR, DEFAULT_SOCKET_PATH);
     else if (sizeof(sock_address.sun_path) <= strlen(sock_path))
-        err("value too long for environmental variable '%s'\n", SOCKET_ENV_VAR);
+        err("The string can't fit in the socket address: '%s'.\n", sock_path);
 
     sock_address.sun_family = AF_UNIX;
     strncpy(sock_address.sun_path, (sock_path == NULL ? DEFAULT_SOCKET_PATH : sock_path), sizeof(sock_address.sun_path));
@@ -36,17 +36,17 @@ int main(int argc, char *argv[])
 
     sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);
     if (sock_fd == -1)
-        err("failed to create socket\n");
+        err("Failed to create the socket.\n");
 
     if (connect(sock_fd, (struct sockaddr *) &sock_address, sizeof(sock_address)) == -1)
-        err("failed to connect to socket\n");
+        err("Failed to connect to the socket.\n");
 
     if (send(sock_fd, msg, msglen, 0) == -1)
-        err("failed to send data\n");
+        err("Failed to send the data.\n");
 
     int n = recv(sock_fd, rsp, sizeof(rsp), 0);
     if (n == -1) {
-        err("failed to get response\n");
+        err("Failed to get the response.\n");
     } else if (n > 0) {
         rsp[n] = '\0';
         printf("%s\n", rsp);