[PATCH 07/10] command: Replace incorrect use of LENGTH().

Simon Ruderich simon at ruderich.org
Sat Feb 1 21:56:42 CET 2014


LENGTH() has no negative effects because sizeof(char) == 1, but sizeof()
makes the intention clear.
---
 src/command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/command.c b/src/command.c
index acdf994..ea9060c 100644
--- a/src/command.c
+++ b/src/command.c
@@ -571,7 +571,7 @@ struct wcd { /* window id completion data */
 static void add_winid_completion(void* key, HSClient* client, struct wcd* data)
 {
     char buf[100];
-    snprintf(buf, LENGTH(buf), "0x%lx", client->window);
+    snprintf(buf, sizeof(buf), "0x%lx", client->window);
     try_complete(data->needle, buf, data->output);
 
 }
-- 
1.8.5.3

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140201/d3edaba6/attachment.asc>


More information about the hlwm mailing list