Fix logic error when checking for a devstate provider.

When using strsep, if one of the list of specified separators is not found,
it is the first parameter to strsep which is now NULL, not the pointer returned
by strsep.

This issue isn't especially severe in that the worst it is likely to do is waste
some cycles when a device with no '/' and no ':' is passed to ast_device_state.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@263639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2010-05-17 22:00:28 +00:00
parent 109a363733
commit 760f0a8a8b
+1 -1
View File
@@ -145,7 +145,7 @@ int ast_device_state(const char *device)
number = buf;
if (!number) {
provider = strsep(&tech, ":");
if (!provider)
if (!tech)
return AST_DEVICE_INVALID;
/* We have a provider */
number = tech;