PATH_MAX is defined via limits.h (I hope that exists on all
systems). MAX_PATH is a typo. int r was never used. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1223 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
e7fcb2be88
commit
59da343eea
|
@ -36,6 +36,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -134,7 +135,7 @@ static int get_profile_from_config(struct sc_card *card, char *card_prof_name)
|
||||||
struct sc_context *ctx = card->ctx;
|
struct sc_context *ctx = card->ctx;
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
scconf_block **blocks, *blk;
|
scconf_block **blocks, *blk;
|
||||||
int i, r;
|
int i;
|
||||||
|
|
||||||
for (i = 0; ctx->conf_blocks[i]; i++) {
|
for (i = 0; ctx->conf_blocks[i]; i++) {
|
||||||
blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i],
|
blocks = scconf_find_blocks(ctx->conf, ctx->conf_blocks[i],
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -353,7 +354,7 @@ static const char *
|
||||||
sc_profile_locate(const char *name)
|
sc_profile_locate(const char *name)
|
||||||
{
|
{
|
||||||
static char path[1024];
|
static char path[1024];
|
||||||
char profile_dir[MAX_PATH];
|
char profile_dir[PATH_MAX];
|
||||||
|
|
||||||
/* Name with suffix tagged onto it? */
|
/* Name with suffix tagged onto it? */
|
||||||
snprintf(path, sizeof(path), "%s.%s", name, SC_PKCS15_PROFILE_SUFFIX);
|
snprintf(path, sizeof(path), "%s.%s", name, SC_PKCS15_PROFILE_SUFFIX);
|
||||||
|
|
Loading…
Reference in New Issue