Changeset 08b5601 in mainline


Ignore:
Timestamp:
2009-03-24T15:14:02Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10d73d8
Parents:
e560ae8
Message:

fix off-by-one bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/printf/vsnprintf.c

    re560ae8 r08b5601  
    8787                        wchar_t uc = utf8_decode(str, &index, size - 1);
    8888                       
    89                         if (!utf8_encode(uc, data->dst, &data->len, data->size - 1))
     89                        if (!utf8_encode(uc, data->dst, &data->len, data->size - 2))
    9090                                break;
    9191                       
     
    150150                }
    151151               
    152                 if (!utf8_encode(str[index], data->dst, &data->len, data->size - 1))
     152                if (!utf8_encode(str[index], data->dst, &data->len, data->size - 2))
    153153                        break;
    154154               
Note: See TracChangeset for help on using the changeset viewer.