FreeCalypso > hg > freecalypso-hwlab
comparison simtool/pberase.c @ 115:0dcd666292e4
fc-simtool: pb-erase-one command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 Jan 2021 02:56:10 +0000 |
parents | 87d459d9797a |
children | 87b34a244901 |
comparison
equal
deleted
inserted
replaced
114:34c090f35515 | 115:0dcd666292e4 |
---|---|
27 if (rc < 0) | 27 if (rc < 0) |
28 return(rc); | 28 return(rc); |
29 } | 29 } |
30 return(0); | 30 return(0); |
31 } | 31 } |
32 | |
33 cmd_pb_erase_one(argc, argv) | |
34 char **argv; | |
35 { | |
36 int rc; | |
37 unsigned recno; | |
38 u_char record[255]; | |
39 | |
40 rc = phonebook_op_common(argv[1]); | |
41 if (rc < 0) | |
42 return(rc); | |
43 recno = strtoul(argv[2], 0, 0); | |
44 if (recno < 1 || recno > curfile_record_count) { | |
45 fprintf(stderr, "error: specified record number is invalid\n"); | |
46 return(-1); | |
47 } | |
48 memset(record, 0xFF, curfile_record_len); | |
49 return update_rec_op(recno, 0x04, record, curfile_record_len); | |
50 } |