Permalink
Browse files

Fixing analyzer warning. Fixes issue #40

  • Loading branch information...
1 parent 9440aec commit 9537faaaec752d6aa319a88853fa9cfcc7e03d3a @robbiehanson robbiehanson committed Jun 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Lumberjack/DDTTYLogger.m
View
@@ -1212,7 +1212,7 @@ - (void)logMessage:(DDLogMessage *)logMessage
NSUInteger msgLen = [logMsg lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
const BOOL useStack = msgLen < (1024 * 4);
- char msgStack[useStack ? (msgLen + 1) : 0];
+ char msgStack[useStack ? (msgLen + 1) : 1]; // Analyzer doesn't like zero-size array, hence the 1
char *msg = useStack ? msgStack : (char *)malloc(msgLen + 1);
[logMsg getCString:msg maxLength:(msgLen + 1) encoding:NSUTF8StringEncoding];

0 comments on commit 9537faa

Please sign in to comment.