libDtSearch: Coverity 86579
[oweals/cde.git] / cde / lib / DtTerm / Term / TermBuffer.c
index 307dbaa9e57aebc3b4bf20a89732d3433b16a929..095fed270db94065f4dfcdb42abf7bd9834607c9 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 #ifndef lint
 #ifdef  VERBOSE_REV_INFO
 static char rcs_id[] = "$TOG: TermBuffer.c /main/2 1997/04/17 18:04:41 samborn $";
@@ -17,6 +39,7 @@ static char rcs_id[] = "$TOG: TermBuffer.c /main/2 1997/04/17 18:04:41 samborn $
 #define        USE_MEMCPY      /* use memcpy for line movement... */
 
 #include <Xm/Xm.h>
+#include "TermPrim.h"
 #include "TermHeader.h"       /* for MIN/MAX */
 #include "TermBufferP.h"
 #include "TermEnhance.h"
@@ -24,7 +47,7 @@ static char rcs_id[] = "$TOG: TermBuffer.c /main/2 1997/04/17 18:04:41 samborn $
 /*
 ** clear "count" enhancements starting at startCol
 */
-static
+static void
 clearEnhancements
 (
     TermBuffer tb,
@@ -429,7 +452,7 @@ _DtTermBufferFreeBuffer
 /*
 ** clear all the enhancements from startCol through stopCol
 */
-static
+static void
 clearEnhancements
 (
     TermBuffer tb,
@@ -616,8 +639,8 @@ _DtTermDeleteEnhancement
     ** end of the line to col
     */
     copyCount = WIDTH(line) - (col + width);
-    memcpy(enh + col , enh + col + width,
-           copyCount * sizeof(DtTermEnhPart));
+    memmove(enh + col , enh + col + width,
+            copyCount * sizeof(DtTermEnhPart));
 
 }