Changeset 564


Ignore:
Timestamp:
May 1, 2011, 1:12:15 AM (6 years ago)
Author:
sam
Message:

tool: fix an off-by-one error in the put' and putpcx' commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/tool/abuse-tool.cpp

    r555 r564  
    179179        {
    180180            uint8_t buf[1024];
    181             int step = Min(todo, 1024);
     181            int step = Min((int)todo, 1024);
    182182            fp.read(buf, step);
    183183            fwrite(buf, step, 1, stdout);
     
    275275        dir.entries = (spec_entry **)realloc(dir.entries,
    276276                                             dir.total * sizeof(spec_entry *));
    277         for (int i = id + 1; i < dir.total; i++)
    278             dir.entries[i] = dir.entries[i - 1];
     277        for (int i = dir.total - 1; i-- > id; )
     278            dir.entries[i + 1] = dir.entries[i];
    279279
    280280        char *name = strrchr(argv[5], '/');
Note: See TracChangeset for help on using the changeset viewer.