Skip to content

Fix functions like subtract_whole requiring calloc allocated memory since this is inefficient. #18

Description

@avighnac

subtract_whole.asm:82:93

.after_if_3:
  push   rdi
  push   rcx
  mov    rdi, rdx
  call   strlen_asm wrt ..plt
  pop    rcx
  pop    rdi
  test   cl, cl
  jz     .ret
  mov    byte [rdx+rax+1], 0
  lea    r8, [rax-1]
  xor    ecx, ecx

This code doesn't really do anything (the string is already null terminated, otherwise the call to strlen_asm wouldn't work), and doesn't need to call strlen_asm at all. Fix functions like this so they null terminate efficiently and properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions