check for Null-version...

FossilOrigin-Name: 7dfa074be5eeb13f8dd9a8b648f028d03414271558ba3747a4428e3980915a1e
This commit is contained in:
7u83@mail.ru 2015-03-15 16:23:02 +00:00
parent e18dbf3bf1
commit a5de50b390
1 changed files with 6 additions and 6 deletions

View File

@ -41,12 +41,13 @@
*/
int cw_format_version(char *s, bstr_t ver, uint32_t vendor, char * def)
{
if (!ver)
return sprintf(s,"%s",def);
uint8_t * version = bstr_data(ver);
int len = bstr_len(ver);
if (!version)
return sprintf(s,"%s",def);
int rs=0;
@ -76,9 +77,8 @@ int cw_format_version(char *s, bstr_t ver, uint32_t vendor, char * def)
rs+=sprintf(s+rs,")");
}
rs+=sprintf(s+rs,", Vendor Id: %d, %s",vendor, cw_ianavendoridtostr(vendor));
rs+=sprintf(s+rs,"\n");
if (vendor)
rs+=sprintf(s+rs,", Vendor Id: %d, %s",vendor, cw_ianavendoridtostr(vendor));
return rs;
}