Skip to content

Commit

Permalink
fixed issue tcurdt#35 by using stringWithUTF8String: instead of %s to…
Browse files Browse the repository at this point in the history
… convert to NSString.
  • Loading branch information
seanm committed Mar 25, 2013
1 parent db1c750 commit 4a1e37c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/Main/FRConsoleLog.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011, Torsten Curdt
* Copyright 2008-2013, Torsten Curdt
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -111,7 +111,9 @@ + (NSString*) logSince:(NSDate*)since maxSize:(NSNumber*)maximumSize
for (NSInteger i = consoleLinesProcessed - 1; i >= 0; i--) {
char **line = rawConsoleLines[i];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:atof(line[FR_CONSOLELOG_TIME])];
[consoleLines addObject:[NSString stringWithFormat:@"%@: %s\n", [dateFormatter stringFromDate:date], line[FR_CONSOLELOG_TEXT]]];
NSString *lineString = [NSString stringWithUTF8String:line[FR_CONSOLELOG_TEXT]];
NSString *fullString = [NSString stringWithFormat:@"%@: %@\n", [dateFormatter stringFromDate:date], lineString];
[consoleLines addObject:fullString];

// If a maximum size has been provided, respect it and abort if necessary
if (maximumSize != nil) {
Expand Down

0 comments on commit 4a1e37c

Please sign in to comment.