ALittlePatate / CSS-external

A simple CS:S external cheat
10 stars 2 forks source link

Unnecessary use of sizeof() #3

Closed yoshisaac closed 5 months ago

yoshisaac commented 5 months ago

Hello,

The "size of" the data type char is always going to be one byte. The math in calculating names of players or the map doesn't need sizeof() calls, especially with a data type that is only one byte.

Multiplying numbers by one is useless.

ALittlePatate commented 5 months ago

Hey, thanks the interest you have in this project. The use of sizeof() when allocating memory is good practice, even if sizeof(char) is always 1 on modern hardware. The multiplication you're talking about will be evaluated at compile time, thus resulting in the exact same assembly code.