Skip to content

Commit

Permalink
Fix 'format-overflow' and possible overlap warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarL authored and waddlesplash committed Mar 14, 2024
1 parent db008e7 commit c69274c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Languages/Sources/Html_Popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,12 @@ const char *Anchor(const char *txt, CLanguageProxy& ao)
if (*txt == 0)
break;

char *p = name + kMaxNameSize;
int l = std::min(kMaxNameSize - 1, txt - anchor - 1);
strncpy(name, anchor, l);
name[l] = 0;

sprintf(p, "A: %s", name);

ao.AddFunction(p, name, offset);

BString tmp;
ao.AddFunction(tmp.SetToFormat("A: %s", name).String(), name, offset);
}
}
while (false);
Expand Down

0 comments on commit c69274c

Please sign in to comment.