From b0d09ee39c7c35c727e320ecda50cf36e558b68b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 26 Feb 2014 20:16:26 +0100 Subject: [PATCH] s3:utils: explicitly check the return value of fscanf() to avoid unused warnings in smbta-util.c Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/utils/smbta-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/utils/smbta-util.c b/source3/utils/smbta-util.c index 6dfa0d524be..4c2accd1304 100644 --- a/source3/utils/smbta-util.c +++ b/source3/utils/smbta-util.c @@ -78,7 +78,7 @@ static void load_key_from_file(char *filename, char *key) exit(1); } l = fscanf(keyfile, "%s", key); - if (strlen(key) != 16) { + if (l != 1 || strlen(key) != 16) { printf("Key file in wrong format\n"); fclose(keyfile); exit(1);