Fix for 2038 compatibility

This commit is contained in:
Christophe Grenier 2022-09-10 10:07:50 +02:00
parent 0ae7969c12
commit 7a767a3917
3 changed files with 4 additions and 5 deletions

View file

@ -88,7 +88,6 @@ static int check_FAT_dir_entry(const unsigned char *entry, const unsigned int en
static unsigned long int get_subdirectory(disk_t *disk_car,const uint64_t hd_offset, const unsigned long int i); static unsigned long int get_subdirectory(disk_t *disk_car,const uint64_t hd_offset, const unsigned long int i);
#ifdef HAVE_NCURSES #ifdef HAVE_NCURSES
static void fat_date_unix2dos(int unix_date,unsigned short *mstime, unsigned short *msdate);
static int fat32_create_rootdir(disk_t *disk_car,const partition_t *partition, const unsigned int reserved, const unsigned int fat_length, const unsigned int root_cluster, const unsigned int sectors_per_cluster, const int verbose, file_info_t *rootdir_list, const unsigned int fats); static int fat32_create_rootdir(disk_t *disk_car,const partition_t *partition, const unsigned int reserved, const unsigned int fat_length, const unsigned int root_cluster, const unsigned int sectors_per_cluster, const int verbose, file_info_t *rootdir_list, const unsigned int fats);
static upart_type_t select_fat_info(const info_offset_t *info_offset, const unsigned int nbr_offset,unsigned int*reserved, unsigned int*fat_length, const unsigned long int max_sector_offset, unsigned int *fats); static upart_type_t select_fat_info(const info_offset_t *info_offset, const unsigned int nbr_offset,unsigned int*reserved, unsigned int*fat_length, const unsigned long int max_sector_offset, unsigned int *fats);
#endif #endif
@ -562,7 +561,7 @@ static unsigned int fat32_find_root_cluster(disk_t *disk_car,const partition_t *
#ifdef HAVE_NCURSES #ifdef HAVE_NCURSES
static void fat_date_unix2dos(int unix_date,unsigned short *mstime, unsigned short *msdate) static void fat_date_unix2dos(time_t unix_date,unsigned short *mstime, unsigned short *msdate)
{ {
static const int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 }; static const int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
/* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */ /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */

View file

@ -216,7 +216,7 @@ int partition_save(disk_t *disk_car, const list_part_t *list_part, const int ver
log_critical("Can't create backup.log file: %s\n",strerror(errno)); log_critical("Can't create backup.log file: %s\n",strerror(errno));
return -1; return -1;
} }
fprintf(f_backup,"#%u %s\n",(unsigned int)time(NULL), disk_car->description(disk_car)); fprintf(f_backup,"#%lu %s\n",(unsigned long int)time(NULL), disk_car->description(disk_car));
for(parts=list_part;parts!=NULL;parts=parts->next) for(parts=list_part;parts!=NULL;parts=parts->next)
{ {
char status='D'; char status='D';

View file

@ -225,8 +225,8 @@ int session_save(const alloc_data_t *list_free_space, const struct ph_param *par
{ {
log_trace("session_save\n"); log_trace("session_save\n");
} }
fprintf(f_session,"#%u\n%s %s,%u,", fprintf(f_session,"#%lu\n%s %s,%u,",
(unsigned int)time(NULL), params->disk->device, params->disk->arch->part_name_option, params->partition->order); (unsigned long int)time(NULL), params->disk->device, params->disk->arch->part_name_option, params->partition->order);
if(params->blocksize>0) if(params->blocksize>0)
fprintf(f_session,"blocksize,%u,", params->blocksize); fprintf(f_session,"blocksize,%u,", params->blocksize);
fprintf(f_session,"fileopt,"); fprintf(f_session,"fileopt,");