title: C# how to deal with integer overflows when returning status code from application in unix environment
body: <p>I have a program similar to this</p>
  <pre><code>public static class Program
  {
      public const int BAD_SCRIPT = 1337;
  
      private static async Task&lt;int&gt; main(string[] args)
      {
          string script = ParseArguments(args);
          return await GetSomeResult(script);
      }
      
      private static async Task&lt;int&gt; GetSomeResult(string script)
      {
          return string.IsNullOrEmpty(script) ? BAD_SCRIPT : 0;
      }
  }
  </code></pre>
  <p>This works fine on the windows environment and returns the expected error. However, in Unix it returns the modulus of 256 due to integer overflow. My question to you is how do I deal with this scenario? This causes the API request to return a wrong error.</p>