fixed potential use before initialization
This commit is contained in:
@@ -132,7 +132,8 @@ static void xj_preport(xj_error *error, const char *src, int off, const char *fm
|
|||||||
{
|
{
|
||||||
if(error != NULL)
|
if(error != NULL)
|
||||||
{
|
{
|
||||||
int row, col;
|
int row = -1,
|
||||||
|
col = -1;
|
||||||
if(src != NULL)
|
if(src != NULL)
|
||||||
{
|
{
|
||||||
// Calculate column and row given
|
// Calculate column and row given
|
||||||
@@ -1368,7 +1369,7 @@ static _Bool encode_string(const char *str, int len, buffer_t *buff)
|
|||||||
}
|
}
|
||||||
else if((unsigned char) str[i] < 32)
|
else if((unsigned char) str[i] < 32)
|
||||||
{
|
{
|
||||||
char *m;
|
char *m = NULL;
|
||||||
switch(str[i])
|
switch(str[i])
|
||||||
{
|
{
|
||||||
case '\t': m = "\\t"; break;
|
case '\t': m = "\\t"; break;
|
||||||
@@ -1382,6 +1383,8 @@ static _Bool encode_string(const char *str, int len, buffer_t *buff)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(m != NULL);
|
||||||
|
|
||||||
if(!append_string(buff, m, 2))
|
if(!append_string(buff, m, 2))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user