Mercurial > pidgin
comparison libpurple/protocols/msn/command.c @ 23494:c1cba867b3da
Avoid a NULL reference in msn_command_from_string.
References #5545.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 21 Jun 2008 06:50:53 +0000 |
parents | f1345f4338e3 |
children | 7e16d193bb57 |
comparison
equal
deleted
inserted
replaced
23493:c5891c8d0c28 | 23494:c1cba867b3da |
---|---|
105 cmd->params = g_strsplit(param_start, " ", 0); | 105 cmd->params = g_strsplit(param_start, " ", 0); |
106 } | 106 } |
107 | 107 |
108 if (cmd->params != NULL) | 108 if (cmd->params != NULL) |
109 { | 109 { |
110 char *param; | |
111 int c; | 110 int c; |
112 | 111 |
113 for (c = 0; cmd->params[c]; c++); | 112 for (c = 0; cmd->params[c]; c++); |
114 cmd->param_count = c; | 113 cmd->param_count = c; |
115 | 114 |
116 param = cmd->params[0]; | 115 if (cmd->param_count) { |
117 | 116 char *param = cmd->params[0]; |
118 cmd->trId = is_num(param) ? atoi(param) : 0; | 117 cmd->trId = is_num(param) ? atoi(param) : 0; |
118 } else { | |
119 cmd->trId = 0; | |
120 } | |
119 } | 121 } |
120 else | 122 else |
121 { | 123 { |
122 cmd->trId = 0; | 124 cmd->trId = 0; |
123 } | 125 } |