alpine 3.6
obsolete weakness #54

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

libcaca/src/libcaca-0.99.beta19/src/cacaclock.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 
        // figfont API is not complete, and does not allow us to put a string
        // at another position than 0,0
        // So, we have to create a canvas which will hold the figfont string,
        // then blit this canvas to the main one at the desired position.
        caca_clear_canvas(cv);
        caca_clear_canvas(figcv);
        while(d[o])
        {
            caca_put_figchar(figcv, d[o++]);
        }
        caca_flush_figlet (figcv);
        free(d);

        w = caca_get_canvas_width (cv);
        h = caca_get_canvas_height(cv);
        fw = caca_get_canvas_width (figcv);
        fh = caca_get_canvas_height(figcv);

        uint32_t x = (w/2) - (fw/2);
        uint32_t y = (h/2) - (fh/2);

        caca_blit(cv, x, y, figcv, NULL);
        caca_refresh_display(dp);
        usleep(250000);
    }
end:

    caca_free_canvas(figcv);
    caca_free_canvas(cv);
    caca_free_display(dp);

    return 0;
} 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.