Code: Select all
if (isalpha(c1) && isalpha(c2))
Code: Select all
DcmItem::foundVR()
DcmItem::checkTransferSyntax()
DcmMetaInfo::checkAndReadPreamble()
DcmMetaInfo::read()
DcmFileFormat::read()
DcmFileFormat::loadFile()
So when the character read by DcmFileFormat::loadFile() is less than -1, we typically have undefined behaviour in our medical application!!!The header <ctype.h> declares several functions useful for testing and mapping characters. In all cases the argument is an int, the value of which shall be representable as an unsigned char or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined.
Can you please get this bug out of DcmItem::foundVR()? The problem is easily solved, by casting the argument to unsigned char, before calling isalpha:
Code: Select all
if (isalpha(OFstatic_cast(unsigned char, c1)) && isalpha(OFstatic_cast(unsigned char, c2)))
Newsgroup: microsoft.public.vc.language
Subject: [CRT] How to avoid isalpha(c) assert failure?
http://www.microsoft.com/communities/ne ... EB+isalpha
PS BTW, is this the best place, when reporting a bug like this?