|
|
View previous topic :: View next topic |
Author |
Message |
Tagge
Joined: 23 Aug 2005 Posts: 93
|
Length of string TCP/IP? |
Posted: Wed Apr 15, 2009 8:37 am |
|
|
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
|
|
Posted: Wed Apr 15, 2009 12:20 pm |
|
|
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
|
|
Posted: Thu Apr 16, 2009 2:39 am |
|
|
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 |
|
|
|
|
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
|