From e0b796f3c5aa5bcbd5b52212a493be12c5cc9823 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 12 Oct 2012 18:10:52 +0200 Subject: [PATCH] inpcom.c, rewrite --- src/frontend/inpcom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index c42871dd0..0010ece76 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1338,10 +1338,9 @@ get_model_type(char *line) static char * get_adevice_model_name(char *line) { - char *model_name, *ptr_end = line + strlen(line), *ptr_beg, keep; + char *model_name, *ptr_end, *ptr_beg, keep; - while (isspace(*(ptr_end-1))) - ptr_end--; + ptr_end = skip_back_ws(line + strlen(line) - 1) + 1; ptr_beg = skip_back_non_ws(ptr_end - 1) + 1; keep = *ptr_end; *ptr_end = '\0';