Ad
  • Custom User Avatar

    You are right! Thank you

  • Custom User Avatar

    by that time i didn't know about sprintf)

  • Default User Avatar

    Right now you are using logical OR to check if no requirement is violated
    If you were to check if the requirements were met instead ( <= turns into >, >= turns into < etc)
    and use logical AND to chain the checks, it would be a tiny bit more efficient.
    If any of the requirements are not met, the rest of the expression does not need to be evaluated
    as one false in a chain of ANDs will always equal false.

    In this example the impact is negligeble but it is best practice to fail fast.

  • Custom User Avatar

    strcat spam is what happens when you don't know about sprintf