summaryrefslogtreecommitdiff
path: root/UMain.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UMain.pas')
-rw-r--r--UMain.pas12
1 files changed, 5 insertions, 7 deletions
diff --git a/UMain.pas b/UMain.pas
index 5c96866..2f5a2d3 100644
--- a/UMain.pas
+++ b/UMain.pas
@@ -2948,12 +2948,11 @@ begin
if Key = GDK_KEY_BackSpace then begin
if g_utf8_strlen(PChar(Entry.Text), -1) > 0 then begin
// DebugMsg(['TFMain.QuickFindSendKey: before delete: "', Entry.Text, '", ansi = "', UTF8ToStr(Entry.Text), '"']);
- g := malloc(Length(Entry.Text));
- memset(g, 0, Length(Entry.Text));
+ g := g_malloc0(Length(Entry.Text));
g_utf8_strncpy(g, PChar(Entry.Text), g_utf8_strlen(PChar(Entry.Text), -1) - 1);
// DebugMsg(['TFMain.QuickFindSendKey: after delete: "', g, '", ansi = "', UTF8ToStr(g), '"']);
Entry.Text := g;
- libc_free(g);
+ g_free(g);
end;
NewText := Entry.Text;
end else
@@ -5558,11 +5557,10 @@ procedure TFMain.SetTabLabel(Notebook: TEphyNotebook; PageIndex: integer; ALabel
var g: PChar;
begin
if (ConfTabMaxLength > 0) and (g_utf8_strlen(PChar(ALabel), -1) > ConfTabMaxLength) then begin
- g := malloc(Length(ALabel) + 4);
- memset(g, 0, Length(ALabel) + 4);
+ g := g_malloc0(Length(ALabel) + 4);
g_utf8_strncpy(g, PChar(ALabel), ConfTabMaxLength);
ALabel := g + '...';
- libc_free(g);
+ g_free(g);
end;
Notebook.SetTabCaption(PageIndex, ALabel);
Notebook.SetTabTooltip(PageIndex, ATooltip);
@@ -6239,7 +6237,7 @@ begin
DebugMsg(['(II) ExtractFromArchive: New path = ', NewPath]);
// Test for read access to the new file
- if (not ExtractAll) and (access(PChar(NewPath), R_OK) <> 0) then begin
+ if (not ExtractAll) and (g_access(PChar(NewPath), R_OK) <> 0) then begin
Result := False;
DebugMsg(['(EE) ExtractFromArchive: access test to the new file failed.']);
end;