mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-07 14:24:14 +01:00
WINGs: WMIsPL* functions return False if proplist is null.
Previously, calls to WMIsPLString, WMIsPLData, WMIsPLArray, and WMIsPLDictionary would result in a segfault if the argument was null. This could happen, e.g., if we are checking which type of proplist was just parsed from a file, but the parsing failed. These functions now return False in this case.
This commit is contained in:
committed by
Carlos R. Mafra
parent
101ef6f28e
commit
6f195b18fc
@@ -1253,22 +1253,34 @@ int WMGetPropListItemCount(WMPropList * plist)
|
||||
|
||||
Bool WMIsPLString(WMPropList * plist)
|
||||
{
|
||||
return (plist->type == WPLString);
|
||||
if (plist)
|
||||
return (plist->type == WPLString);
|
||||
else
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool WMIsPLData(WMPropList * plist)
|
||||
{
|
||||
return (plist->type == WPLData);
|
||||
if (plist)
|
||||
return (plist->type == WPLData);
|
||||
else
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool WMIsPLArray(WMPropList * plist)
|
||||
{
|
||||
return (plist->type == WPLArray);
|
||||
if (plist)
|
||||
return (plist->type == WPLArray);
|
||||
else
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool WMIsPLDictionary(WMPropList * plist)
|
||||
{
|
||||
return (plist->type == WPLDictionary);
|
||||
if (plist)
|
||||
return (plist->type == WPLDictionary);
|
||||
else
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool WMIsPropListEqualTo(WMPropList * plist, WMPropList * other)
|
||||
|
||||
Reference in New Issue
Block a user