Added hanlding of null value

This commit is contained in:
Robert Osfield
2016-06-29 17:51:32 +01:00
parent 467054ba44
commit d0bf7e8ce7

View File

@@ -85,14 +85,21 @@ void trpgRange::SetCategory(const char *cat,const char *subCat)
void trpgRange::GetCategory(char *cat,int catLen,char *subCat,int subCatLen) const
{
if (category && cat) {
strncpy(cat,category,catLen);
} else
*cat = 0;
if (subCategory && subCat) {
strncpy(subCat,subCategory,subCatLen);
} else
*subCat = 0;
if (cat)
{
if (category) {
strncpy(cat,category,catLen);
} else
*cat = 0;
}
if (subCat)
{
if (subCategory) {
strncpy(subCat,subCategory,subCatLen);
} else
*subCat = 0;
}
}
void trpgRange::SetLodInfo(double in,double out)