mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
* ser_posix.c, ser_win32.c, serial.h:
Change baud from int to long to avoid a 16-bit int overflow. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@291 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2003-03-13 Theodore A. Roth <troth@openavr.org>
|
||||
|
||||
* ser_posix.c, ser_win32.c, serial.h:
|
||||
Change baud from int to long to avoid a 16-bit int overflow.
|
||||
|
||||
2003-03-12 Theodore A. Roth <troth@openavr.org>
|
||||
|
||||
* Makefile.am (avrdude_SOURCES): Add avr910.[ch], serial.h and
|
||||
|
@@ -36,7 +36,7 @@
|
||||
extern char *progname;
|
||||
|
||||
struct baud_mapping {
|
||||
int baud;
|
||||
long baud;
|
||||
speed_t speed;
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ static struct baud_mapping baud_lookup_table [] = {
|
||||
{ 0, 0 } /* Terminator. */
|
||||
};
|
||||
|
||||
static speed_t serial_baud_lookup(int baud)
|
||||
static speed_t serial_baud_lookup(long baud)
|
||||
{
|
||||
struct baud_mapping *map = baud_lookup_table;
|
||||
|
||||
@@ -65,12 +65,12 @@ static speed_t serial_baud_lookup(int baud)
|
||||
map++;
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %d",
|
||||
fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %ld",
|
||||
progname, baud);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static int serial_setattr(int fd, int baud)
|
||||
static int serial_setattr(int fd, long baud)
|
||||
{
|
||||
int rc;
|
||||
struct termios termios;
|
||||
|
@@ -20,14 +20,16 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* Posix serial interface for avrdude.
|
||||
* Native Win32 serial interface for avrdude.
|
||||
*/
|
||||
|
||||
#include "serial.h"
|
||||
|
||||
extern char *progname;
|
||||
|
||||
#if 0
|
||||
|
||||
int serial_open(char * port, int baud)
|
||||
int serial_open(char * port, long baud)
|
||||
{
|
||||
return fd;
|
||||
}
|
||||
|
Reference in New Issue
Block a user