Changeset 1894


Ignore:
Timestamp:
Sep 9, 2012, 4:55:30 PM (7 years ago)
Author:
sam
Message:

neercs: fix two potential crashes, one caused by mismatched delete/delete[]
and one caused by a bug in the current version of libcaca.

Location:
trunk/tools/neercs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/term/pty.cpp

    r1890 r1894  
    5454{
    5555#if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
    56     delete m_unread_data;
     56    delete[] m_unread_data;
    5757
    5858    if (m_fd >= 0)
  • trunk/tools/neercs/video/render.cpp

    r1885 r1894  
    865865            if ((setup_var[setup_item_key].y - setup_var[setup_item_key].x) / setup_var[setup_item_key].z > 1)
    866866            {
    867                 caca_printf(m_caca, setup_p.x + setup_size.x - 4, y, "%4.2f", setup_var[setup_item_key].w);
     867                /* Work around a bug in libcaca */
     868                if (setup_p.x + setup_size.x - 4 < caca_get_canvas_width(m_caca))
     869                    caca_printf(m_caca, setup_p.x + setup_size.x - 4, y, "%4.2f", setup_var[setup_item_key].w);
    868870                caca_draw_line(m_caca, x, y, x - bar_x + bar_w * setup_var[setup_item_key].y, y,'.');
    869871                if (setup_var[setup_item_key].w != setup_var[setup_item_key].x) caca_draw_line(m_caca, x, y, x - bar_x + bar_w * setup_var[setup_item_key].w, y,'x');
Note: See TracChangeset for help on using the changeset viewer.