Issue information

Issue ID
#4765
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Feb 16, 2011 19:23
Last Post
Hercules Elf Bot
Feb 16, 2011 19:23
Confirmation
N/A

Hercules Elf Bot - Feb 16, 2011 19:23

Originally posted by [b]xazax[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4765

CODE
/// calculates the value of A / B, in percent (rounded down)
unsigned int get_percentage(const unsigned int A, const unsigned int B)
{
    double result;

    if( B == 0 )
    {
        ShowError("get_percentage(): divison by zero! (A=%u,B=%u)\n", A, B);
        return -1;
    }


unsigned return type function tried to return a signed value.

also in malloc.c

void* _mmalloc(size_t size, const char *file, int line, const char *func ) function accepts int type line, however:

CODE
struct unit_head {
    struct block   *block;
    const  char*   file;
    unsigned short line;
    unsigned short size;
    long           checksum;
};


Line is unsigned short.

This post has been edited by xazax: Feb 16 2011, 11:29 AM