Rizin
unix-like reverse engineering framework and cli tools
zip_set_default_password.c File Reference
#include <stdlib.h>
#include <string.h>
#include "zipint.h"

Go to the source code of this file.

Functions

ZIP_EXTERN int zip_set_default_password (zip_t *za, const char *passwd)
 

Function Documentation

◆ zip_set_default_password()

ZIP_EXTERN int zip_set_default_password ( zip_t za,
const char *  passwd 
)

Definition at line 42 of file zip_set_default_password.c.

42  {
43  if (za == NULL)
44  return -1;
45 
47 
48  if (passwd && passwd[0] != '\0') {
49  if ((za->default_password = strdup(passwd)) == NULL) {
51  return -1;
52  }
53  }
54  else
56 
57  return 0;
58 }
#define NULL
Definition: cris-opc.c:27
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
Definition: zip_error.c:126
#define ZIP_ER_MEMORY
Definition: zip.h:119
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
zip_error_t error
Definition: zipint.h:281
char * default_password
Definition: zipint.h:286
zip_t * za
Definition: ziptool.c:79

References zip::default_password, zip::error, free(), NULL, strdup(), za, ZIP_ER_MEMORY, and zip_error_set().

Referenced by main(), and set_password().