From 171c88dcbea203b0f170143e561006066a47aee3 Mon Sep 17 00:00:00 2001 From: Grisha Levit Date: Tue, 1 Nov 2022 02:13:42 -0400 Subject: [PATCH] fix int format in search results Since `trackId` is an `Int` and can be a number greater than `Int32.max`, it should be printed with the `%ld` format specifier [1]. [1]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW5 --- Sources/MasKit/Formatters/SearchResultFormatter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MasKit/Formatters/SearchResultFormatter.swift b/Sources/MasKit/Formatters/SearchResultFormatter.swift index 03160cfd..f79caac3 100644 --- a/Sources/MasKit/Formatters/SearchResultFormatter.swift +++ b/Sources/MasKit/Formatters/SearchResultFormatter.swift @@ -26,9 +26,9 @@ enum SearchResultFormatter { let price = result.price ?? 0.0 if includePrice { - output += String(format: "%12d %@ $%5.2f (%@)\n", appId, appName, price, version) + output += String(format: "%12ld %@ $%5.2f (%@)\n", appId, appName, price, version) } else { - output += String(format: "%12d %@ (%@)\n", appId, appName, version) + output += String(format: "%12ld %@ (%@)\n", appId, appName, version) } }