delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/11/06:06:52

Sender: aditya AT wipsys DOT soft DOT net
Message-ID: <35CB167B.7B4FC27F@wipsys.soft.net>
Date: Fri, 07 Aug 1998 10:00:11 -0500
From: Aditya Kapur <aditya AT wipsys DOT soft DOT net>
Organization: Wipro Systems
MIME-Version: 1.0
To: Chia <chia AT top DOT net>, djgpp AT delorie DOT com
Subject: Re: Strange Function Behavior
References: <6qdq5j$as2 AT nnrp2 DOT farm DOT idt DOT net>

this loop is executing strlen everytime so when you overwrite the last 0
character the size changes. i recomend that you use something like this

int len;

len=(int)strlen(name):
for(int c = i; c < len;c++) name[c] = name[c + 1];

Chia wrote:
 
>     Well, I commented out code and found that in parseTitle, I found that
> the loop
> 
>        for(int c = i; c < (int)strlen(name);c++) name[c] = name[c + 1];
> 
>     was causing the problems.
>
aditya

-- 
--------------------------------------------------
Aditya Kapur			Wipro Infotech Ltd.
Sr. Systems Engg.		40/1A Lavelle Road,
Ph 080-2215010 Extn 109         Bangalore -1, INDIA
---------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019