Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1508

function axutil_strtol in util/src/types.c can't convert negative number from string.('-32134556' will be converted to 0)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.0
    • None
    • util
    • all envireonments

    Description

      you will know this problem when you look at this function, if input parameter s is '1234567', then first char is '', the for loop will breaks, the this function return 0 to you.
      the function is :

      AXIS2_EXTERN int64_t AXIS2_CALL
      axutil_strtol(
      const char *s,
      char **endptr,
      int base)
      {
      int i;
      int64_t n;

      n = 0;
      for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i)

      { n = 10 * n + (s[i] - '0'); }

      if(endptr != NULL)

      { *endptr = (char *)(s + i); }

      return n;
      }

      Attachments

        1. axis2c-src-1.6.0-7.patch
          2 kB
          Andreas Vollmy

        Activity

          People

            Unassigned Unassigned
            zengxianrui zengxianrui-
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified