~ubuntu-branches/ubuntu/edgy/psqlodbc/edgy

« back to all changes in this revision

Viewing changes to misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2004-11-14 16:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20041114161231-hurw3wphq2vr9sr4
Tags: 1:07.03.0200-5
* Corrected license to old LGPL 2
* Big debian/rules modernization
* Moved odbc.ini.template to examples directory
* Converted to dpatch
* Added update of config.{guess,sub}
* Renamed unixodbc.HOWTO to README.Debian; revised
* Moved installation to /usr/lib/odbc; added symlink to old location
  for compatibility
* Dropped postgresql-dev dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
/*------
260
260
 *      Create a null terminated string (handling the SQL_NTS thing):
261
261
 *              1. If buf is supplied, place the string in there
262
 
 *                 (at most bufsize-1 bytes) and return buf.
263
 
 *              2. If buf is not supplied, malloc space and return this string;
264
 
 *                 (buflen is ignored in this case).
 
262
 *                 (assumes enough space) and return buf.
 
263
 *              2. If buf is not supplied, malloc space and return this string
265
264
 *------
266
265
 */
267
266
char *
268
 
make_string(const char *s, int len, char *buf, int bufsize)
 
267
make_string(const char *s, int len, char *buf)
269
268
{
270
269
        int                     length;
271
270
        char       *str;
276
275
 
277
276
                if (buf)
278
277
                {
279
 
                        if(length >= bufsize)
280
 
                                length = bufsize-1;
281
278
                        strncpy_null(buf, s, length + 1);
282
279
                        return buf;
283
280
                }