Skip to content

Some natives should return string length #1079

Closed

Description

@NexiusTailer

Describe the bug
All the following natives:

  • GetWeaponName
  • NetStats_GetIpPort
  • GetPVarNameAtIndex
  • GetSVarNameAtIndex

should return the length of a string it wrote the data to.

GetWeaponName

To Reproduce

new str[32];
new ret = GetWeaponName(WEAPON_DEAGLE, str, sizeof str);
printf("ret %d, str '%s'", ret, str);

Expected behavior

ret 12, str 'Desert Eagle'

Current behavior

ret 1, str 'Desert Eagle'
NetStats_GetIpPort

To Reproduce

new str[32];
new ret = NetStats_GetIpPort(playerid, str, sizeof str);
printf("ret %d, str '%s'", ret, str);

Expected behavior

ret 15, str '127.0.0.1:62365'

Current behavior

ret 1, str '127.0.0.1:62365'
GetPVarNameAtIndex

To Reproduce

new str[32];
SetPVarString(playerid, "test", "abracadabra");
new ret = GetPVarNameAtIndex(playerid, 0, str, sizeof str);
printf("ret %d, str '%s'", ret, str);

Expected behavior

ret 4, str 'TEST'

Current behavior

ret 1, str 'TEST'
GetSVarNameAtIndex

To Reproduce

new str[32];
SetSVarString("test", "abracadabra");
new ret = GetSVarNameAtIndex(0, str, sizeof str);
printf("ret %d, str '%s'", ret, str);

Expected behavior

ret 4, str 'TEST'

Current behavior

ret 1, str 'TEST'

Activity

  1. added
    bug
    on Apr 20, 2025
  2. changed the title [-]GetWeaponName should return string length[/-] [+]Some natives should return string length[/+] on Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions