Changeset 22 for trunk/src/sh_gpg.c


Ignore:
Timestamp:
Feb 23, 2006, 12:03:58 AM (19 years ago)
Author:
rainer
Message:

Minor code revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_gpg.c

    r1 r22  
    209209  FILE * outf = NULL;
    210210  char * envp[2];
     211  size_t len;
    211212  char   path[256];
    212213  char   cc1[32];
     
    370371  if (sh.effective.home != NULL)
    371372    {
    372       envp[0] = malloc (sl_strlen(sh.effective.home) + 6); /* free() ok   */
     373      len = sl_strlen(sh.effective.home) + 6;
     374      envp[0] = malloc (len); /* free() ok   */
    373375      if (envp[0] != NULL)
    374         sprintf (envp[0], "HOME=%s",                     /* known to fit  */
    375                  sh.effective.home);
     376        sl_snprintf (envp[0], len, "HOME=%s", sh.effective.home);
    376377      envp[1] = NULL;
    377378    }
     
    486487
    487488      pfd = get_the_fd(checkfd);
    488       sprintf(pname, _("/proc/self/fd/%d"),             /* known to fit  */
    489                    pfd);
    490       if (0 == access(pname, R_OK|X_OK))
     489      sl_snprintf(pname, sizeof(pname), _("/proc/self/fd/%d"), pfd);
     490      if (0 == access(pname, R_OK|X_OK))               /* flawfinder: ignore */
     491
    491492        {
    492493          fcntl  (pfd, F_SETFD, FD_CLOEXEC);
Note: See TracChangeset for help on using the changeset viewer.