aboutsummaryrefslogtreecommitdiffstats
path: root/devicestate.c
diff options
context:
space:
mode:
Diffstat (limited to 'devicestate.c')
-rwxr-xr-xdevicestate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/devicestate.c b/devicestate.c
index fabed739d..086cadbf4 100755
--- a/devicestate.c
+++ b/devicestate.c
@@ -195,12 +195,13 @@ static void do_state_change(const char *device)
static int __ast_device_state_changed_literal(char *buf)
{
- char *device;
- char *parse;
+ char *device, *tmp;
struct state_change *change = NULL;
- parse = buf;
- device = strsep(&parse, "-");
+ device = buf;
+ tmp = strrchr(device, '-');
+ if (tmp)
+ *tmp = '\0';
if (change_thread != AST_PTHREADT_NULL)
change = calloc(1, sizeof(*change) + strlen(device));