Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > strcpy_s vs str...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 27 Topic 9762 of 9909
Post > Topic >>

strcpy_s vs strcpy

by Trups <Samant.Trupti@[EMAIL PROTECTED] > Jul 2, 2008 at 05:33 AM

Hi,

 I have changed my strcpy to strcpy_s for 2005 project.  It's fairly
big project and was using strycpy lot of places.
The program started corrupting the stack and in turn cra****ng the
application.  We have realized that it is due to strcpy_s.  We have
changes that to strpcy and then it was fine.
There are some places the destlength was more then whatever size of
deststr.  I know it is a mistake but the copy string had character to
copy.  So I was thinking it shouldn't crash the project. Isn't that
true?

Example:
deststr[128];
copystr[] = "Test String";
destlength = 256;

strcpy_s(deststr, destlength, copystr);
even strcpy_s(deststr, strlen(copystr), copystr); was cra****ng (I need
to look more for this)

But is there any known problem with strcpy_s?
Thanks
Trupti

--
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 27 Posts in Topic:
strcpy_s vs strcpy
Trups <Samant.Trupti@[  2008-07-02 05:33:01 
Re: strcpy_s vs strcpy
Thomas Richter <thor@[  2008-07-02 11:58:11 
Re: strcpy_s vs strcpy
Pavel Minaev <int19h@[  2008-07-02 11:58:00 
Re: strcpy_s vs strcpy
Phil Hobbs <pcdhSpamMe  2008-07-02 11:58:01 
Re: strcpy_s vs strcpy
Francis Glassborow <fr  2008-07-02 11:58:02 
Re: strcpy_s vs strcpy
Martin Bonner <martinf  2008-07-02 11:58:03 
Re: strcpy_s vs strcpy
Francis Glassborow <fr  2008-07-02 11:58:02 
Re: strcpy_s vs strcpy
Greg Herlihy <greghe@[  2008-07-03 02:33:38 
Re: strcpy_s vs strcpy
Mathias Gaunard <loufo  2008-07-03 03:28:10 
Re: strcpy_s vs strcpy
Francis Glassborow <fr  2008-07-03 03:28:05 
Re: strcpy_s vs strcpy
Martin Bonner <martinf  2008-07-03 08:58:01 
Re: strcpy_s vs strcpy
Thomas Richter <thor@[  2008-07-03 08:53:03 
Re: strcpy_s vs strcpy
Francis Glassborow <fr  2008-07-03 08:55:08 
Re: strcpy_s vs strcpy
Bart van Ingen Schenau &l  2008-07-03 15:45:53 
Re: strcpy_s vs strcpy
Martin Bonner <martinf  2008-07-03 15:45:25 
Re: strcpy_s vs strcpy
Greg Herlihy <greghe@[  2008-07-04 19:27:10 
Re: strcpy_s vs strcpy
"Stephen Howe"   2008-07-05 04:02:40 
Re: strcpy_s vs strcpy
red floyd <no.spam.her  2008-07-05 12:21:33 
Re: strcpy_s vs strcpy
Greg Herlihy <greghe@[  2008-07-06 05:58:11 
Re: strcpy_s vs strcpy
Pavel Minaev <int19h@[  2008-07-06 06:00:18 
Re: strcpy_s vs strcpy
=?UTF-8?B?RXJpayBXaWtzdHL  2008-07-06 16:33:29 
Re: strcpy_s vs strcpy
"Alf P. Steinbach&qu  2008-07-06 16:33:34 
Re: strcpy_s vs strcpy
Greg Herlihy <greghe@[  2008-07-07 06:44:36 
Re: strcpy_s vs strcpy
Eberhard Schefold <ebe  2008-07-07 08:58:44 
Re: strcpy_s vs strcpy
Maxim Yegorushkin <max  2008-07-07 09:00:47 
Re: strcpy_s vs strcpy
"Alf P. Steinbach&qu  2008-07-07 09:11:55 
Re: strcpy_s vs strcpy
Jorgen Grahn <grahn+nn  2008-07-07 17:35:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 13:11:32 CDT 2008.