Changeset 14067


Ignore:
Timestamp:
Apr 13, 2013, 6:29:56 PM (9 years ago)
Author:
jordan
Message:

(trunk libT) #5316 'UMR in quark, tr-getopt code': fixed.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/quark.c

    r14009 r14067  
    400400  const struct tr_key_struct * b = vb;
    401401
    402   ret = memcmp (a->str, b->str, a->len);
     402  ret = memcmp (a->str, b->str, MIN (a->len, b->len));
    403403
    404404  if (!ret && (a->len != b->len))
  • trunk/libtransmission/tr-getopt.c

    r13625 r14067  
    150150        size_t len = o->longName ? strlen (o->longName) : 0;
    151151
    152         if ((matchlen < len) && !memcmp (str, "--", 2)
    153           && !memcmp (str + 2, o->longName, len)
     152        if ((matchlen < len)
     153          && (str[0] == '-')
     154          && (str[1] == '-')
     155          && !strncmp (str+2, o->longName, len)
    154156          && (str[len + 2] == '\0' || (o->has_arg && str[len + 2] == '=')))
    155157        {
     
    161163        len = o->shortName ? strlen (o->shortName) : 0;
    162164
    163         if ((matchlen < len) && !memcmp (str, "-", 1)
    164           && !memcmp (str + 1, o->shortName, len)
     165        if ((matchlen < len)
     166          && (str[0] == '-')
     167          && !strncmp (str+1, o->shortName, len)
    165168          && (str[len + 1] == '\0' || o->has_arg))
    166169        {
Note: See TracChangeset for help on using the changeset viewer.