Project

General

Profile

Bug #1867

mktemp(3) gives bad advice in EXAMPLES section

Added by Yuri Pankov over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
manpage - manual pages
Start date:
2011-12-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
mktemp

Description

         #include <stdlib.h>
         ...
         char *template = "/tmp/fileXXXXXX";
         char *ptr;
         ptr = mktemp(template);

This expects strings to be writable, and gcc doesn't agree with it (gcc4 doesn't even have the option anymore).

History

#1

Updated by Rich Lowe over 8 years ago

For what it's worth, with all these write-strings bugs, the same is true of newer Sun Studio too.

#2

Updated by Rich Lowe over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Resolved in r13550 commit:84f53d070f62

Also available in: Atom PDF