CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Length of string TCP/IP?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

Length of string TCP/IP?
PostPosted: Wed Apr 15, 2009 8:37 am     Reply with quote

Hi, does anyone know the default length of the string in:
Code:

int8 http_format_char(int32 file, char id, char *str, int8 max_ret)

Length of max-ret? = size of *str.
And how can I make it bigger? or isn't it possible?
How could I then put out a longer string, for ex 256 chars, at the web page?
Right now I can only display about 25 chars at the time, and I have tried to increase the buffer inside the function, but its the max_ret that keeps it short. If I use the true length (len) of the string it can show once and the whole string, but then the web side crashes.
Code:

if (len){
        strncpy(str,new_str,len);
        //strncpy(str,new_str,max_ret); //original
   }else
      *str=0;

Thanks/Tagge
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 15, 2009 12:20 pm     Reply with quote

Get a text search program and search for that function name.
This will tell you what file is calling that function. Then look at the
variable declarations above the call. You will see size of the array.
Then you can edit it to be longer.

I searched for "http_format_char" and it's called by these files,
at a minimum:
Quote:
c:\program files\picc\projects\ccstcpip\tcpip\http.c
c:\program files\picc\tcp-ip\pic examples source\drivers\http.c
c:\program files\picc\tcp-ip\pic examples source\tcpip\http2.c
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

PostPosted: Thu Apr 16, 2009 2:39 am     Reply with quote

Hi, found it out.. if you want 200 chars for ex.
is in the file http.c
and the following function:
Code:

int1 tcp_http_put_file(int8 which, int16 errorCode, int32 file, char *contentType)

and the change to be made is:
Code:
static char str[200];//changed from 40

Thanks/Tagge
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group