2 // https://code.google.com/p/address-sanitizer/issues/detail?id=274.
4 // RUN: %clang_asan %s -framework Foundation -o %t
5 // RUN: %run %t 2>&1 | FileCheck %s
6 #import <Foundation/Foundation.h>
11 NSString* version_file = @"MAJOR=35\n";
12 int major = 0, minor = 0, build = 0, patch = 0;
13 NSScanner* scanner = [NSScanner scannerWithString:version_file];
15 if ([scanner scanString:@"MAJOR=" intoString:nil] &&
16 [scanner scanInt:&major]) {
17 res = [NSString stringWithFormat:@"%d.%d.%d.%d",
18 major, minor, build, patch];
20 printf("%s\n", [res UTF8String]);