-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.c
More file actions
38 lines (34 loc) · 825 Bytes
/
Copy patherrors.c
File metadata and controls
38 lines (34 loc) · 825 Bytes
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
29
30
31
32
33
34
35
36
37
38
#include "main.h"
/**
* printerror - print error message and shell loop count
* @in: pointer to an array of strings, user input
* @name: pointer to program name
* @loop: number of shell loops
*
* Return: void
*/
void printerror(char *name, char *in, int loop)
{
char *e = _itoa(loop);
print(name);
print(": ");
print(e), free(e);
print(": ");
print(in);
print(": not found\n");
}
/**
* exiterror - print error message and shell loop count
* @argv: pointer to an array of strings, user input
* @tokens: pointer to program name
* @loop: number of shell loops
*
* Return: void
*/
void exiterror(char **argv, char **tokens, int loop)
{
char *e = _itoa(loop);
print(argv[0]), print(": "), print(e), print(": ");
print(tokens[0]), print(": Illegal number: "), print(tokens[1]);
print("\n"), free(e);
}