bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mkid from id-utils segvs on GNU/Linux


From: Sam Roberts
Subject: mkid from id-utils segvs on GNU/Linux
Date: Fri, 8 Dec 2000 16:10:59 -0500
User-agent: Mutt/1.3.9i

The problem is this snippet of code:

char* dot = (char*) ".";

The compiler warns about this, the cast removes the warning, and
the string is passed to strtok(), which segvs when attempting to write
it.

On GNU/Linux, gcc puts string literals in read-only data.

Something like this is necessary:

char dot[] = ".";
char* dotp= dot;
argv = &dotp;

Sam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]