* Re: Unable to set UDB serial port speed RedHat4.2/2.0.30
[not found] <01bcfe7f$60288060$323ccbd0@zeke.bainet.com>
@ 1997-12-01 18:42 ` Joakim Roubert
1997-12-01 19:03 ` Strange errors from strtok() Rob Zook
1 sibling, 0 replies; 6+ messages in thread
From: Joakim Roubert @ 1997-12-01 18:42 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
On Mon, 1 Dec 1997, Hunter Ware wrote:
> medicine mind you, what did it was upgrading to 2.1.46. This kernel has
> been stable like a rock for me. P.S I haven't touched a thing since. *grin*
...and then Jokke started his mighty ftp-client....
If God exist, it will work for me too. Thank you for this tip!
/Jokke tmw.
---
* Origin: FUW95 http://www.efd.lth.se/~d97jro/ (2:200/127.9)
Jag använder ett 64-bitars operativsystem. Gör du? :nigirO *
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Strange errors from strtok()
[not found] <01bcfe7f$60288060$323ccbd0@zeke.bainet.com>
1997-12-01 18:42 ` Unable to set UDB serial port speed RedHat4.2/2.0.30 Joakim Roubert
@ 1997-12-01 19:03 ` Rob Zook
1997-12-01 19:51 ` Richard Henderson
1997-12-01 20:14 ` Michal Jaegermann
1 sibling, 2 replies; 6+ messages in thread
From: Rob Zook @ 1997-12-01 19:03 UTC (permalink / raw)
Hi all,
Hopefully, someone here has done some c programming on these Alphas.
I have a UDB and I'm running RedHat 4.1 w/ some of the RedHat 4.2
upgrades.
I'm trying to use the strtok function from stdlib in a program and
I get these strange errors:
#include <stdio.h>
#include <stdlib.h>
main()
{
char postline[80];
char tokenName[10][80];
char tokenValue[10][80];
char Name[30];
char Extension[9];
char Friend[5];
char *tokenPtr;
printf("Content-type: text/html\n\n");
printf("<HTML>\n<BODY>\n");
printf("<B>CONTENT LENGTH</B> = %d<BR>\n",
atoi(getenv("CONTENT_LENGTH")));
while(gets(postline)!= NULL)
{
printf("%s<BR>\n", postline);
tokenPtr = strtok(postline,"&");<<<<<<<<
do
{
printf("<B>TokenPtr</B> = %s<BR>\n", tokenPtr);
}
while((tokenPtr = strtok(NULL,'&'))==NULL); <<<<<<<<<
}
printf("</BODY>\n</HTML>\n");
}
When I try to compile this program I get the following warnings:
[rzook@babylon5 cgi-bin]$ cc -o rsvp rsvp.c
rsvp.c: In function `main':
rsvp.c:20: warning: assignment makes pointer from integer without a cast
rsvp.c:25: warning: assignment makes pointer from integer without a cast
/tmp/cca197261.o: In function `main':
rsvp.c(.text+0x8c): the `gets' function is dangerous and should not be used.
In the above program lines 20 and 25 are marked with the "<<<<<<<".
I'm not sure why I'd get these warnings. cc produces an executable, but
When I run this cgi program from my web form, it produces a server error.
If I add a fflush(stdout), just before the do loop, the server error goes
away and I get some output. However, the execution only goes thru the
do loop once, and then next call to strtok evidently returns a NULL.
The results of the program with the fflush(stdout) look like this:
CONTENT LENGTH = 52
name=Rob+Zook&extension=1111&guest=yes&beverage=beer
TokenPtr = name=Rob+Zook
As you can see the returned postline has 52 characters in it, and
with a call to strtok like: tokenPtr = strtok(NULL,'&') I should
get 4 tokens back. But I only get one.
To summarize:
1. Why do the warnings occur?
2. Why does my loop fail on the second call to strtok?
Thanks,
Rob Z.
--------------------------------------------------------
Not reaching a goal on a given day does not preclude
reaching it tomorrow, or next year. One failure does not
mean all is lost. Let it be motivation to improve, to
deliver optimum performance in the next undertaking,
whatever it may be - not to give up and quit trying.
-- Capt. Spock
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Strange errors from strtok()
1997-12-01 19:03 ` Strange errors from strtok() Rob Zook
@ 1997-12-01 19:51 ` Richard Henderson
1997-12-01 20:14 ` Michal Jaegermann
1 sibling, 0 replies; 6+ messages in thread
From: Richard Henderson @ 1997-12-01 19:51 UTC (permalink / raw)
On Mon, Dec 01, 1997 at 01:03:09PM -0600, Rob Zook wrote:
> I'm trying to use the strtok function from stdlib in a program and
> I get these strange errors:
Except that strtok isn't in <stdlib.h>, but in <string.h>.
r~
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Strange errors from strtok()
1997-12-01 19:03 ` Strange errors from strtok() Rob Zook
1997-12-01 19:51 ` Richard Henderson
@ 1997-12-01 20:14 ` Michal Jaegermann
1 sibling, 0 replies; 6+ messages in thread
From: Michal Jaegermann @ 1997-12-01 20:14 UTC (permalink / raw)
Rob Zook wrote:
> I'm trying to use the strtok function from stdlib in a program and
^^^^^^^^^^^^^^^^^^^^
strtok() is not in stdlib
> I get these strange errors:
...therefore errors are not strange at all.
> [rzook@babylon5 cgi-bin]$ cc -o rsvp rsvp.c
> rsvp.c: In function `main':
> rsvp.c:20: warning: assignment makes pointer from integer without a cast
> rsvp.c:25: warning: assignment makes pointer from integer without a cast
strtok() is not declared, so compiler assumes a default 'int' as a type
of a return value. You try to assign this to a pointer. This is a bug
in your code.
> /tmp/cca197261.o: In function `main':
> rsvp.c(.text+0x8c): the `gets' function is dangerous and should not be used.
Indeed! Anybody feeding your program a line longer than your buffer
will crash it or worse (manipulating your stack one can make your
program to execute any code at all). Big fun in a CGI context when
you apparently are heading.
Michal
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Unable to set UDB serial port speed RedHat4.2/2.0.30
@ 1997-12-01 17:34 Hunter Ware
0 siblings, 0 replies; 6+ messages in thread
From: Hunter Ware @ 1997-12-01 17:34 UTC (permalink / raw)
I had this problem for a long time and nothing seemed to fix the problem.
It was even more frustrating for me because I remembered that under RH 3.0.3
the high speed had worked. For me the problem went away suddenly after I
had given up. I was in the middle of a bunch of upgrades and boom I noticed
the serial ports worked. As near as I could tell, and this _is_ voodoo
medicine mind you, what did it was upgrading to 2.1.46. This kernel has
been stable like a rock for me. P.S I haven't touched a thing since. *grin*
\||// Hunter Ware <ware@bainet.com>
oO Research Associate - Barron Associates Inc.
()^() 1160 Pepsi Place, Charlottesville, Va, 22901
U Phone (804) 973-1215 FAX (804) 973-4686
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Unable to set UDB serial port speed RedHat4.2/2.0.30
@ 1997-12-01 6:20 Mark W. Davis
0 siblings, 0 replies; 6+ messages in thread
From: Mark W. Davis @ 1997-12-01 6:20 UTC (permalink / raw)
I have been attempting to set the serial port speed on my
old VX40 to 115200. Nothing seems to work... it always
defaults to 38400. Setserial reports base_baud of 115200;
I have in rc.serial '/bin/setserial /dev/ttyS0 spd_vhi' but
DTE is still 38400. Does anyone have any pointers? BTW, I
searched RedHat's axp archives and saw others mention this
problem but didn't see any resolution.
--
Mark W. Davis <><><><><><><><><><><><><><><><><> davis@aa.net
0x8659F7F9 96 9D 44 C1 1D E4 A7 13 2F 8D 7A C5 3A A7 4D 1A
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1997-12-01 20:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <01bcfe7f$60288060$323ccbd0@zeke.bainet.com>
1997-12-01 18:42 ` Unable to set UDB serial port speed RedHat4.2/2.0.30 Joakim Roubert
1997-12-01 19:03 ` Strange errors from strtok() Rob Zook
1997-12-01 19:51 ` Richard Henderson
1997-12-01 20:14 ` Michal Jaegermann
1997-12-01 17:34 Unable to set UDB serial port speed RedHat4.2/2.0.30 Hunter Ware
-- strict thread matches above, loose matches on Subject: below --
1997-12-01 6:20 Mark W. Davis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox