summaryrefslogtreecommitdiffstats
path: root/src/time64.c
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 /src/time64.c
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.
Diffstat (limited to 'src/time64.c')
-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)
346*/ 346*/
347static int safe_year(const Year year) 347static int safe_year(const Year year)
348{ 348{
349 int safe_year; 349 int safe_year= (int)year;
350 Year year_cycle; 350 Year year_cycle;
351 351
352 if( year >= MIN_SAFE_YEAR && year <= MAX_SAFE_YEAR ) { 352 if( year >= MIN_SAFE_YEAR && year <= MAX_SAFE_YEAR ) {
353 return (int)year; 353 return safe_year;
354 } 354 }
355 355
356 year_cycle = year + cycle_offset(year); 356 year_cycle = year + cycle_offset(year);