summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Greg Dennis2017-04-14 05:21:45 -0400
committerGravatar GitHub2017-04-14 05:21:45 -0400
commit415c35a5f75f1192561fe1426465bbfcf0f30d65 (patch)
tree9391e2b6313fc6c5d29853e62de8e4ac18fc9433
parentff7aecf1127fe9d1aee0ba56a0a6c625667cb396 (diff)
downloadlibplist-415c35a5f75f1192561fe1426465bbfcf0f30d65.tar.gz
libplist-415c35a5f75f1192561fe1426465bbfcf0f30d65.tar.bz2
Initialize safe_year in time64.c
Clang fails with stricter compilation options, because it thinks safe_year may be uninitialized at the return statement. The logic prevents it from being uninitialized, but probably worth the initialization to avoid the compiler error. The rest of libimobiledevice compiles successfully under the same options.
-rw-r--r--src/time64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/time64.c b/src/time64.c
index 371f2f9..8c08caf 100644
--- a/src/time64.c
+++ b/src/time64.c
@@ -346,11 +346,11 @@ static Year cycle_offset(Year year)
*/
static int safe_year(const Year year)
{
- int safe_year;
+ int safe_year= (int)year;
Year year_cycle;
if( year >= MIN_SAFE_YEAR && year <= MAX_SAFE_YEAR ) {
- return (int)year;
+ return safe_year;
}
year_cycle = year + cycle_offset(year);