summaryrefslogtreecommitdiff
path: root/os2/mktemp.c
blob: e70507aaee18915c6dabe4b3810871478da9a1f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* MKTEMP.C using TMP environment variable */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>

void Mktemp(char *file)
{
  char fname[32], *tmp;

  tmp = getenv("TMP");

  if ( tmp != NULL )
  {
    strcpy(fname, file);
    strcpy(file, tmp);

    if ( file[strlen(file) - 1] != '\\' )
      strcat(file, "\\");

    strcat(file, fname);
  }

  mktemp(file);
}

/* End of MKTEMP.C */