This issue was found by Cppcheck (static C/C++ code analysis tool).
void PrintEditorGadgetInfoText(struct GadgetInfo *gi)
{
char infotext[MAX_OUTPUT_LINESIZE + 1];
void PrintEditorGadgetInfoText(struct GadgetInfo *gi)
{
char infotext[MAX_OUTPUT_LINESIZE + 1];
- char shortcut[MAX_OUTPUT_LINESIZE + 1];
int max_infotext_len = getMaxInfoTextLength();
if (gi == NULL || strlen(gi->info_text) == 0)
int max_infotext_len = getMaxInfoTextLength();
if (gi == NULL || strlen(gi->info_text) == 0)
+ char shortcut[MAX_OUTPUT_LINESIZE + 1];
+
if (gi->custom_id == GADGET_ID_SINGLE_ITEMS)
sprintf(shortcut, " ('.' or '%c')", key);
else if (gi->custom_id == GADGET_ID_PICK_ELEMENT)
if (gi->custom_id == GADGET_ID_SINGLE_ITEMS)
sprintf(shortcut, " ('.' or '%c')", key);
else if (gi->custom_id == GADGET_ID_PICK_ELEMENT)
static void HandleDrawingAreaInfo(struct GadgetInfo *gi)
{
static void HandleDrawingAreaInfo(struct GadgetInfo *gi)
{
- static int start_lx, start_ly;
int id = gi->custom_id;
int type_id = gi->custom_type_id;
int sx = gi->event.x;
int id = gi->custom_id;
int type_id = gi->custom_type_id;
int sx = gi->event.x;
int actual_drawing_function = drawing_function;
int max_infotext_len = getMaxInfoTextLength();
char infotext[MAX_OUTPUT_LINESIZE + 1];
int actual_drawing_function = drawing_function;
int max_infotext_len = getMaxInfoTextLength();
char infotext[MAX_OUTPUT_LINESIZE + 1];
infotext[0] = '\0'; // start with empty info text
infotext[0] = '\0'; // start with empty info text
{
if (button_status) // if (gi->state == GD_BUTTON_PRESSED)
{
{
if (button_status) // if (gi->state == GD_BUTTON_PRESSED)
{
+ static int start_lx = 0;
+ static int start_ly = 0;
+ char *text;
+
if (gi->event.type == GD_EVENT_PRESSED)
{
start_lx = lx;
if (gi->event.type == GD_EVENT_PRESSED)
{
start_lx = lx;