Minor BUGFIX - Samba 2.0.6 / make_smbcodepage.c

John E. Malmberg wb8tyw at qsl.net
Thu Mar 2 23:49:42 GMT 2000


I am getting a compile time warning about trying pass a 32 bit unsigned
integer to a print format specifier that is only 16 bits in module
SMBCODEPAGE.C

Putting in the cast below on the result of the SVAL() macro removes the
problem.

The platform specifics:

SAMBA 2.0.6
OpenVMS ALPHA 7.2
DEC C 6.0
Compile flags: /DEBUG/WARN/ENABLE=LEVEL4/PREFIX=ALL


(new)
File PROJECT_ROOT:[SAMBA_VMS.UTILS]MAKE_SMBCODEPAGE.C;
  356     /* Check the version value */
  357     if(SVAL(header_buf,CODEPAGE_VERSION_OFFSET) !=
CODEPAGE_FILE_VERSION_ID)
  358     {
  359       fprintf(stderr, "%s: filename %s has incorrect version id. \
  360   Needed %hu, got %hu.\n",
  361             prog_name, input_file, (uint16)CODEPAGE_FILE_VERSION_ID,
  362             (uint16)SVAL(header_buf,CODEPAGE_VERSION_OFFSET));
  363       exit(1);
  364     }
  365
  366     /* Check the codepage matches */
  367     if(SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET) !=
(uint16)codepage)
  368     {
  369       fprintf(stderr, "%s: filename %s has incorrect codepage. \
  370   Needed %hu, got %hu.\n",
  371              prog_name, input_file, (uint16)codepage,
  372
(uint16)SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET));
  373       exit(1);
  374     ******

(OLD)
File CMS_ROOT:[SAMBA.SOURCE.UTILS]MAKE_SMBCODEPAGE.C;2
  356     /* Check the version value */
  357     if(SVAL(header_buf,CODEPAGE_VERSION_OFFSET) !=
CODEPAGE_FILE_VERSION_ID)
  358

  359       fprintf(stderr, "%s: filename %s has incorrect version id. \
  360   Needed %hu, got %hu.\n",
  361             prog_name, input_file, (uint16)CODEPAGE_FILE_VERSION_ID,
  362             SVAL(header_buf,CODEPAGE_VERSION_OFFSET));
  363       exit(1);
  364     }
  365
  366     /* Check the codepage matches */
  367     if(SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET) !=
(uint16)codepage)
  368

  369       fprintf(stderr, "%s: filename %s has incorrect codepage. \
  370   Needed %hu, got %hu.\n",
  371              prog_name, input_file, (uint16)codepage,
  372              SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET));
  373       exit(1);
  374     }
************




More information about the samba-technical mailing list