remove OSF1 support
[oweals/cde.git] / cde / programs / dtudcfonted / libfuty / getfname.c
index 10d5285cb7307ce0146dbfaf5d630efd89eba757..0c1be5def284be6d4697897580211e042ab17973 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
+ */
 /* $XConsortium: getfname.c /main/9 1996/11/08 02:06:43 cde-fuj $ */
 /*
  *  (c) Copyright 1995 FUJITSU LIMITED
 #if !defined( SYSV )
 #include <sys/resource.h>
 #endif
-#ifdef __osf__
-#define _BSD
-#endif
 #include  <sys/wait.h>
-#ifdef __osf__
-#undef _BSD
-#endif
 #else
 #include  <wait.h>
 #endif /* SVR4 */
@@ -711,7 +727,7 @@ char        *name;
                                return  NULL;
                        }
                }
-               link_name[len] = '\0';
+               link_name[len-1] = 0;
                if ( link_name[0] == '/' ) {
                        /* strcpy( ret_name, link_name ) ; */
                        FreeString( ret_name ) ;
@@ -821,7 +837,7 @@ char                *fname ;
                        return(-2) ;
                    }
                case _FAL_MALOC_ER :
-                   USAGE("System call error occured.\n" ) ;
+                   USAGE("System call error occurred.\n" ) ;
                    return(-2) ;
                default :
                    USAGE3("There is no font file correspond to specified font.\n(%s)\n fal_utyerror = %d fal_utyderror = %d\n",
@@ -1025,7 +1041,7 @@ char      **fontname ;
 {
        FILE    *fp ;
        pid_t   chld_pid = 0;
-#if defined( SVR4 ) || defined( SYSV )
+#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(linux)
        int     chld_stat ;
 #else
        union   wait    chld_stat ;
@@ -1120,7 +1136,7 @@ char      **fontname ;
                    ep++ ;
                }
                *ep = '\0' ;
-               strcpy(fntbuf, sp) ;
+               snprintf(fntbuf, sizeof(fntbuf), "%s", sp) ;
                getstat |= 0x01 ;
                fclose( fp );
                if (head.snf_file != NULL) {