~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-updates

« back to all changes in this revision

Viewing changes to cmd-line-utils/libedit/terminal.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-07-16 13:59:34 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20150716135934-plzpylrt211i3se4
Tags: 5.5.44-0ubuntu0.12.04.1
* SECURITY UPDATE: Update to 5.5.44 to fix security issues (LP: #1475294)
  - http://www.oracle.com/technetwork/topics/security/cpujul2015-2367936.html
  - CVE-2015-2582
  - CVE-2015-2620
  - CVE-2015-2643
  - CVE-2015-2648
  - CVE-2015-4737
  - CVE-2015-4752
  - CVE-2015-4757

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*      $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $   */
2
2
 
3
3
/*-
4
 
 * Copyright (c) 1992, 1993
 
4
 * Copyright (c) 1992, 2015
5
5
 *      The Regents of the University of California.  All rights reserved.
6
6
 *
7
7
 * This code is derived from software contributed to Berkeley by
1271
1271
/* terminal_writec():
1272
1272
 *      Write the given character out, in a human readable form
1273
1273
 */
1274
 
protected void
 
1274
protected int
1275
1275
terminal_writec(EditLine *el, Int c)
1276
1276
{
1277
1277
        Char visbuf[VISUAL_WIDTH_MAX +1];
1278
1278
        ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c);
1279
 
        visbuf[vcnt] = '\0';
1280
 
        terminal_overwrite(el, visbuf, (size_t)vcnt);
1281
 
        terminal__flush(el);
 
1279
        if(vcnt == -1)
 
1280
                return 1;   /* Error due to insufficient space */
 
1281
        else {
 
1282
                visbuf[vcnt] = '\0';
 
1283
                terminal_overwrite(el, visbuf, (size_t)vcnt);
 
1284
                terminal__flush(el);
 
1285
                return 0;
 
1286
        }
1282
1287
}
1283
1288
 
1284
1289