Changeset 1320 for trunk


Ignore:
Timestamp:
Nov 28, 2010, 5:43:54 PM (10 years ago)
Author:
Peter Johansson
Message:

prefer PATH_MAX over MAXPATHLEN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility.cc

    r1291 r1320  
    3838#include <stdexcept>
    3939#include <string>
    40 #include <sys/param.h>
    4140#include <sys/stat.h>
    4241#include <unistd.h>
     
    229228  std::string pwd(void)
    230229  {
    231     char buffer[MAXPATHLEN];
    232     if (!getcwd(buffer, MAXPATHLEN))
     230    char buffer[PATH_MAX];
     231    if (!getcwd(buffer, PATH_MAX))
    233232      throw yat::utility::errno_error("pwd: ");
    234233    return std::string(buffer);
Note: See TracChangeset for help on using the changeset viewer.