Date: Mon, 04 Dec 2000 01:48:35 -0500 (EST) From: Mike Heffner <mheffner@vt.edu> To: FreeBSD-audit <FreeBSD-audit@freebsd.org> Subject: cursor patch Message-ID: <XFMail.20001204014835.mheffner@vt.edu>
next in thread | raw e-mail | index | archive | help
This fixes the overflow on the -d option of cursor(1). Index: cursor.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pcvt/cursor/cursor.c,v retrieving revision 1.7 diff -u -r1.7 cursor.c --- cursor.c 1999/01/01 08:31:55 1.7 +++ cursor.c 2000/12/04 06:44:15 @@ -45,6 +45,7 @@ *---------------------------------------------------------------------------*/ #include <stdio.h> +#include <err.h> #include <fcntl.h> #include <sys/stat.h> #include <machine/pcvt_ioctl.h> @@ -104,29 +105,15 @@ fd = DEFAULTFD; } else - { if((fd = open(device, O_RDWR)) == -1) - { - char buffer[80]; - strcpy(buffer,"ERROR opening "); - strcat(buffer,device); - perror(buffer); - exit(1); - } - } + err(1, "ERROR opening %s", device); if(screen == -1) { struct stat stat; if((fstat(fd, &stat)) == -1) - { - char buffer[80]; - strcpy(buffer,"ERROR opening "); - strcat(buffer,device); - perror(buffer); - exit(1); - } + err(1, "ERROR opening %s", device); screen = minor(stat.st_rdev); } @@ -136,10 +123,7 @@ cursorshape.screen_no = screen; if(ioctl(fd, VGACURSOR, &cursorshape) == -1) - { - perror("cursor - ioctl VGACURSOR failed, error"); - exit(1); - } + err(1, "cursor - ioctl VGACURSOR failed, error"); else exit(0); } -- Mike Heffner <mheffner@vt.edu> Blacksburg, VA ICQ# 882073 http://my.ispchannel.com/~mheffner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20001204014835.mheffner>