chore(clang): Fix 'Array subscript is undefined' #15057

This commit is contained in:
ansimita 2021-07-11 14:59:23 +00:00 committed by GitHub
parent 22b5381396
commit e5b75d41db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2398,8 +2398,16 @@ static int prt_add_resource(struct prt_ps_resource_S *resource)
EMSG2(_("E456: Can't open file \"%s\""), resource->filename);
return FALSE;
}
prt_dsc_resources("BeginResource", prt_resource_types[resource->type],
(char *)resource->title);
switch (resource->type) {
case PRT_RESOURCE_TYPE_PROCSET:
case PRT_RESOURCE_TYPE_ENCODING:
case PRT_RESOURCE_TYPE_CMAP:
prt_dsc_resources("BeginResource", prt_resource_types[resource->type],
(char *)resource->title);
break;
default:
return FALSE;
}
prt_dsc_textline("BeginDocument", (char *)resource->filename);