1 |
// -*- C++ -*- |
// -*- C++ -*- |
2 |
/* Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc. |
/* Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. |
3 |
* |
* |
4 |
* Gaius Mulley (gaius@glam.ac.uk) wrote output.cpp |
* Gaius Mulley (gaius@glam.ac.uk) wrote output.cpp |
5 |
* but it owes a huge amount of ideas and raw code from |
* but it owes a huge amount of ideas and raw code from |
67 |
word::word (const char *w, int n) |
word::word (const char *w, int n) |
68 |
: next(0) |
: next(0) |
69 |
{ |
{ |
70 |
s = (char *)malloc(n+1); |
s = new char[n+1]; |
71 |
strncpy(s, w, n); |
strncpy(s, w, n); |
72 |
s[n] = (char)0; |
s[n] = (char)0; |
73 |
} |
} |
78 |
|
|
79 |
word::~word () |
word::~word () |
80 |
{ |
{ |
81 |
free(s); |
a_delete s; |
82 |
} |
} |
83 |
|
|
84 |
/* |
/* |