@@ -569,48 +569,48 @@ CMS_STATUS CMS_ASCII_UPDATER::update(unsigned int *x, unsigned int len)
569569
570570/* Long functions */
571571
572- CMS_STATUS CMS_ASCII_UPDATER::update (long int &x)
572+ CMS_STATUS CMS_ASCII_UPDATER::update (int64_t &x)
573573{
574574 /* Check to see if the pointers are in the proper range. */
575- if (-1 == check_pointer ((char *) &x, sizeof (long ))) {
575+ if (-1 == check_pointer ((char *) &x, sizeof (int64_t ))) {
576576 return (status = CMS_UPDATE_ERROR);
577577 }
578578
579579 if (encoding) {
580- end_current_string[15 ] = 0 ;
581- sprintf (end_current_string, " %-14ld " , x);
582- if (end_current_string[15 ] != 0 && warning_count < warning_count_max) {
580+ end_current_string[22 ] = 0 ;
581+ sprintf (end_current_string, " %-21ld " , x);
582+ if (end_current_string[22 ] != 0 && warning_count < warning_count_max) {
583583 warning_count++;
584584 rcs_print_error
585- (" CMS_ASCII_UPDATER: (warning) long with value %-14ld caused an overflow\n " ,
585+ (" CMS_ASCII_UPDATER: (warning) int64_t with value %-21ld caused an overflow\n " ,
586586 x);
587587 }
588- end_current_string[15 ] = 0 ;
588+ end_current_string[22 ] = 0 ;
589589 } else {
590- if (-1 == safe_strlen (end_current_string, 16 )) {
590+ if (-1 == safe_strlen (end_current_string, 23 )) {
591591 rcs_print_error (" CMS_ASCII_UPDATER: String is too long.\n " );
592592 return (status = CMS_UPDATE_ERROR);
593593 }
594594 errno = 0 ;
595- long number = strtol (end_current_string, (char **) NULL , 10 );
595+ int64_t number = strtoll (end_current_string, (char **) NULL , 10 );
596596 if (errno != 0 ) {
597597 rcs_print_error
598- (" CMS_ASCII_UPDATER: Error %d occurred during strtol .\n " ,
598+ (" CMS_ASCII_UPDATER: Error %d occurred during strtoll .\n " ,
599599 errno);
600600 return (status = CMS_UPDATE_ERROR);
601601 }
602602 x = number;
603603 }
604- end_current_string += 16 ;
605- length_current_string += 16 ;
604+ end_current_string += 23 ;
605+ length_current_string += 23 ;
606606
607607 return (status);
608608}
609609
610- CMS_STATUS CMS_ASCII_UPDATER::update (long *x, unsigned int len)
610+ CMS_STATUS CMS_ASCII_UPDATER::update (int64_t *x, unsigned int len)
611611{
612612 /* Check to see if the pointers are in the proper range. */
613- if (-1 == check_pointer ((char *) x, sizeof (long ) * len)) {
613+ if (-1 == check_pointer ((char *) x, sizeof (int64_t ) * len)) {
614614 return (status = CMS_UPDATE_ERROR);
615615 }
616616
@@ -622,49 +622,49 @@ CMS_STATUS CMS_ASCII_UPDATER::update(long *x, unsigned int len)
622622 return (status);
623623}
624624
625- CMS_STATUS CMS_ASCII_UPDATER::update (unsigned long int &x)
625+ CMS_STATUS CMS_ASCII_UPDATER::update (uint64_t &x)
626626{
627627 /* Check to see if the pointers are in the proper range. */
628- if (-1 == check_pointer ((char *) &x, sizeof (unsigned long ))) {
628+ if (-1 == check_pointer ((char *) &x, sizeof (uint64_t ))) {
629629 return (status = CMS_UPDATE_ERROR);
630630 }
631631
632632 if (encoding) {
633- end_current_string[15 ] = 0 ;
634- sprintf (end_current_string, " %-14lu " , x);
635- if (end_current_string[15 ] != 0 && warning_count < warning_count_max) {
633+ end_current_string[22 ] = 0 ;
634+ sprintf (end_current_string, " %-21lu " , x);
635+ if (end_current_string[22 ] != 0 && warning_count < warning_count_max) {
636636 warning_count++;
637637 rcs_print_error
638- (" CMS_ASCII_UPDATER: (warning) unsigned long with value %-14ld caused an overflow\n " ,
638+ (" CMS_ASCII_UPDATER: (warning) uint64_t with value %-21ld caused an overflow\n " ,
639639 x);
640640 }
641- end_current_string[15 ] = 0 ;
641+ end_current_string[22 ] = 0 ;
642642 } else {
643- if (-1 == safe_strlen (end_current_string, 16 )) {
643+ if (-1 == safe_strlen (end_current_string, 23 )) {
644644 rcs_print_error (" CMS_ASCII_UPDATER: String is too long.\n " );
645645 return (status = CMS_UPDATE_ERROR);
646646 }
647647 errno = 0 ;
648- unsigned long
649- number = strtoul (end_current_string, (char **) NULL , 10 );
648+ uint64_t
649+ number = strtoull (end_current_string, (char **) NULL , 10 );
650650 if (errno != 0 ) {
651651 rcs_print_error
652- (" CMS_ASCII_UPDATER: Error %d:%s occurred during strtoul of(%s).\n " ,
652+ (" CMS_ASCII_UPDATER: Error %d:%s occurred during strtoull of(%s).\n " ,
653653 errno, strerror (errno), end_current_string);
654654 return (status = CMS_UPDATE_ERROR);
655655 }
656656 x = number;
657657 }
658- end_current_string += 16 ;
659- length_current_string += 16 ;
658+ end_current_string += 23 ;
659+ length_current_string += 23 ;
660660
661661 return (status);
662662}
663663
664- CMS_STATUS CMS_ASCII_UPDATER::update (unsigned long *x, unsigned int len)
664+ CMS_STATUS CMS_ASCII_UPDATER::update (uint64_t *x, unsigned int len)
665665{
666666 /* Check to see if the pointers are in the proper range. */
667- if (-1 == check_pointer ((char *) x, sizeof (unsigned long ) * len)) {
667+ if (-1 == check_pointer ((char *) x, sizeof (uint64_t ) * len)) {
668668 return (status = CMS_UPDATE_ERROR);
669669 }
670670
0 commit comments