Mailinglist Archive: opensuse-programming (118 mails)
| < Previous | Next > |
Re: [suse-programming-e] Programming standards!
- From: Jerry Feldman <gaf@xxxxxxx>
- Date: Fri, 15 Apr 2005 10:59:05 -0400
- Message-id: <200504151059.05701.gaf@xxxxxxx>
On Friday 15 April 2005 10:44 am, Stefan Hundhammer wrote:
> C's string handling for instance sucks - it is the source of most
> security holes that need to be fixed. Buffer overflows happen because C
> does not have a concept for variable length strings - it only has
> character pointers. What a nightmare.
I disagree with your opinion.
A C string is an array of characters.
One must remember that C is NOT a high level language like FORTRAN or COBOL,
it was designed as an implementation language. C++ implements a variable
length string based on the C strings.
Some other languages use a tld type of string where the first byte of the
string contains a length. Languages like BASIC are more flexible because
their string handling is performed under the covers.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
> C's string handling for instance sucks - it is the source of most
> security holes that need to be fixed. Buffer overflows happen because C
> does not have a concept for variable length strings - it only has
> character pointers. What a nightmare.
I disagree with your opinion.
A C string is an array of characters.
One must remember that C is NOT a high level language like FORTRAN or COBOL,
it was designed as an implementation language. C++ implements a variable
length string based on the C strings.
Some other languages use a tld type of string where the first byte of the
string contains a length. Languages like BASIC are more flexible because
their string handling is performed under the covers.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
| < Previous | Next > |