X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cde%2Fprograms%2Fdtpad%2FfileIo.c;h=bf1450aa81393656213a7fc7b886c2e33637fe1b;hb=f0a6172d3fa3cf2c1b370e85fa135dbdfa0c7a56;hp=b75066808d75147b016d34df9fc12b29609328a2;hpb=83b6996daa2c5ae22fc2b69093814cb08314954a;p=oweals%2Fcde.git diff --git a/cde/programs/dtpad/fileIo.c b/cde/programs/dtpad/fileIo.c index b7506680..bf1450aa 100644 --- a/cde/programs/dtpad/fileIo.c +++ b/cde/programs/dtpad/fileIo.c @@ -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: fileIo.c /main/4 1996/10/04 17:24:28 drk $ */ /**********************************<+>************************************* *************************************************************************** @@ -292,7 +314,7 @@ AddPound( strcat(returnBuf, "#"); } else { sprintf(returnBuf, "#%s", tempBuf); - if(returnBuf[strlen(returnBuf) - 1] != (char)'#') + if(strlen(returnBuf) && returnBuf[strlen(returnBuf) - 1] != (char)'#') strcat(returnBuf, "#"); } } else {