telnet: get rid of atoi().
authorDario Lombardo <lomato@gmail.com>
Mon, 12 Sep 2016 10:41:48 +0000 (12:41 +0200)
committerAnders Broman <a.broman58@gmail.com>
Mon, 12 Sep 2016 17:37:42 +0000 (17:37 +0000)
Change-Id: Id445aef1af21fcf176611122a757482c0b22f4bd
Reviewed-on: https://code.wireshark.org/review/17662
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-telnet.c

index a1fbd899d3ac81b1b149e36720bb60f9bbded32f..05ab652c97b63e5209d6659d73844dd07ba008ae 100644 (file)
@@ -225,7 +225,6 @@ static void
 check_tn3270_model(packet_info *pinfo _U_, const char *terminaltype)
 {
   int  model;
-  char str_model[2];
 
   if ((strcmp(terminaltype,"IBM-3278-2-E") == 0) || (strcmp(terminaltype,"IBM-3278-2") == 0) ||
       (strcmp(terminaltype,"IBM-3278-3") == 0) || (strcmp(terminaltype,"IBM-3278-4") == 0) ||
@@ -233,9 +232,7 @@ check_tn3270_model(packet_info *pinfo _U_, const char *terminaltype)
       (strcmp(terminaltype,"IBM-3279-3") == 0) || (strcmp(terminaltype,"IBM-3279-4") == 0) ||
       (strcmp(terminaltype,"IBM-3279-2-E") == 0) || (strcmp(terminaltype,"IBM-3279-2") == 0) ||
       (strcmp(terminaltype,"IBM-3279-4-E") == 0)) {
-    str_model[0] = terminaltype[9];
-    str_model[1] = '\0';
-    model = atoi(str_model);
+    model = terminaltype[9] - '0';
     add_tn3270_conversation(pinfo, 0, model);
   }
 }