Skip to content

Commit

Permalink
kernel: replace some uses of gap_strlcat
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 19, 2021
1 parent e9954e3 commit 9329663
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/opers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,6 @@ Obj NewAndFilter (

Int str_len;
Obj str;
char* s;

RequireFilter(0, oper1, "<oper1>");
RequireFilter(0, oper2, "<oper2>");
Expand All @@ -1185,14 +1184,11 @@ Obj NewAndFilter (

str_len = GET_LEN_STRING(NAME_FUNC(oper1)) + GET_LEN_STRING(NAME_FUNC(oper2)) + 8;
str = NEW_STRING(str_len);
s = CSTR_STRING(str);
s[0] = '(';
s[1] = 0;
gap_strlcat(s, CONST_CSTR_STRING(NAME_FUNC(oper1)), str_len);
gap_strlcat(s, " and ", str_len);
gap_strlcat(s, CONST_CSTR_STRING(NAME_FUNC(oper2)), str_len);
gap_strlcat(s, ")", str_len);
SET_LEN_STRING(str, str_len - 1);
AppendCStr(str, "(", 1);
AppendString(str, NAME_FUNC(oper1));
AppendCStr(str, " and ", 5);
AppendString(str, NAME_FUNC(oper2));
AppendCStr(str, ")", 1);

getter = NewFunctionT( T_FUNCTION, sizeof(OperBag), str, 1,
ArglistObj, (ObjFunc)DoAndFilter );
Expand Down

0 comments on commit 9329663

Please sign in to comment.