Skip to contentSkip to conversation

master - cleanup: use compile time strlen

PATCH Zdenek Kabelac 1 participant 1 message Jul 31, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4a722c5c8bcc902043ece29550a5d61ea7fdbef3
Commit:        4a722c5c8bcc902043ece29550a5d61ea7fdbef3
Parent:        ba1a8878d05e3753d9ae5a98e51afac71f078fc9
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Jul 25 14:18:18 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jul 31 15:24:45 2013 +0200

cleanup: use compile time strlen

Use sizeof instead of strlen().

---
 lib/log/log.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
lib/log/log.c +1 -2
index 06e053f..e0c1e73 100644
@@ -196,8 +196,7 @@ void print_log(int level, const char *file, int line, int dm_errno_or_class,
 	level &= ~(_LOG_STDERR|_LOG_ONCE);
 
 	if (_abort_on_internal_errors &&
-	    !strncmp(format, INTERNAL_ERROR,
-		     strlen(INTERNAL_ERROR))) {
+	    !strncmp(format, INTERNAL_ERROR, sizeof(INTERNAL_ERROR) - 1)) {
 		fatal_internal_error = 1;
 		/* Internal errors triggering abort cannot be suppressed. */
 		_log_suppress = 0;