=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/lex/regex.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/lex/regex.c 2015/11/19 22:16:43 1.2 --- src/usr.bin/lex/regex.c 2015/11/19 23:20:34 1.3 *************** *** 1,4 **** ! /* $OpenBSD: regex.c,v 1.2 2015/11/19 22:16:43 tedu Exp $ */ /** regex - regular expression functions related to POSIX regex lib. */ --- 1,4 ---- ! /* $OpenBSD: regex.c,v 1.3 2015/11/19 23:20:34 tedu Exp $ */ /** regex - regular expression functions related to POSIX regex lib. */ *************** *** 59,68 **** const int errbuf_sz = 200; char *errbuf, *rxerr; ! errbuf = (char*)flex_alloc(errbuf_sz *sizeof(char)); if (!errbuf) flexfatal(_("Unable to allocate buffer to report regcomp")); ! rxerr = (char*)flex_alloc(errbuf_sz *sizeof(char)); if (!rxerr) flexfatal(_("Unable to allocate buffer for regerror")); regerror (err, preg, rxerr, errbuf_sz); --- 59,68 ---- const int errbuf_sz = 200; char *errbuf, *rxerr; ! errbuf = (char*)malloc(errbuf_sz *sizeof(char)); if (!errbuf) flexfatal(_("Unable to allocate buffer to report regcomp")); ! rxerr = (char*)malloc(errbuf_sz *sizeof(char)); if (!rxerr) flexfatal(_("Unable to allocate buffer for regerror")); regerror (err, preg, rxerr, errbuf_sz); *************** *** 87,93 **** if (m == NULL || m->rm_so < 0) return NULL; len = m->rm_eo - m->rm_so; ! str = (char *) flex_alloc ((len + 1) * sizeof (char)); if (!str) flexfatal(_("Unable to allocate a copy of the match")); strncpy (str, src + m->rm_so, len); --- 87,93 ---- if (m == NULL || m->rm_so < 0) return NULL; len = m->rm_eo - m->rm_so; ! str = (char *) malloc ((len + 1) * sizeof (char)); if (!str) flexfatal(_("Unable to allocate a copy of the match")); strncpy (str, src + m->rm_so, len);