"-", sanitized_uid, NULL);
g_free(sanitized_uid);
- if ((fp = fopen(path, "rb")) == NULL) {
+ if ((fp = g_fopen(path, "rb")) == NULL) {
if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
g_free(path);
path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
"uidl-", ac_prefs->recv_server,
"-", ac_prefs->userid, NULL);
- if ((fp = fopen(path, "rb")) == NULL) {
+ if ((fp = g_fopen(path, "rb")) == NULL) {
if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
g_free(path);
session->uidl_table = table;
recv_time = RECV_TIME_NONE;
partial_recv = POP3_TOTALLY_RECEIVED;
- if (sscanf(buf, "%s\t%ld\t%s", uidl, &recv_time, tmp) < 3) {
- if (sscanf(buf, "%s\t%ld", uidl, &recv_time) != 2) {
+ if (sscanf(buf, "%s\t%ld\t%s", uidl, (long int *) &recv_time, tmp) < 3) {
+ if (sscanf(buf, "%s\t%ld", uidl, (long int *) &recv_time) != 2) {
if (sscanf(buf, "%s", uidl) != 1)
continue;
else {
g_free(sanitized_uid);
- if ((fp = fopen(path, "wb")) == NULL) {
+ if ((fp = g_fopen(path, "wb")) == NULL) {
FILE_OP_ERROR(path, "fopen");
g_free(path);
return -1;
if (msg->uidl && msg->received &&
(!msg->deleted || session->state != POP3_DONE))
fprintf(fp, "%s\t%ld\t%d\n",
- msg->uidl, msg->recv_time, msg->partial_recv);
+ msg->uidl, (long int) msg->recv_time, msg->partial_recv);
}
if (fclose(fp) == EOF) FILE_OP_ERROR(path, "fclose");
g_return_val_if_fail(file != NULL, -1);
- if ((fp = fopen(file, "wb")) == NULL) {
+ if ((fp = g_fopen(file, "wb")) == NULL) {
FILE_OP_ERROR(file, "fopen");
return -1;
}
prev = data;
while ((cur = (gchar *)my_memmem(prev, len - (prev - data), "\r\n", 2))
!= NULL) {
- if ((cur > prev && fwrite_atomic(prev, 1, cur - prev, fp) < 1) ||
+ if ((cur > prev && fwrite(prev, 1, cur - prev, fp) < 1) ||
fputc('\n', fp) == EOF) {
FILE_OP_ERROR(file, "fwrite");
g_warning("can't write to file: %s\n", file);
fclose(fp);
- unlink(file);
+ g_unlink(file);
return -1;
}
}
if (prev - data < len &&
- fwrite_atomic(prev, 1, len - (prev - data), fp) < 1) {
+ fwrite(prev, 1, len - (prev - data), fp) < 1) {
FILE_OP_ERROR(file, "fwrite");
g_warning("can't write to file: %s\n", file);
fclose(fp);
- unlink(file);
+ g_unlink(file);
return -1;
}
if (data[len - 1] != '\r' && data[len - 1] != '\n') {
FILE_OP_ERROR(file, "fputc");
g_warning("can't write to file: %s\n", file);
fclose(fp);
- unlink(file);
+ g_unlink(file);
return -1;
}
}
if (fclose(fp) == EOF) {
FILE_OP_ERROR(file, "fclose");
- unlink(file);
+ g_unlink(file);
return -1;
}
{
Pop3Session *pop3_session = POP3_SESSION(session);
Pop3ErrorValue val = PS_SUCCESS;
- const guchar *body;
+ const gchar *body;
body = msg;
if (pop3_session->state != POP3_GETRANGE_UIDL_RECV &&
if (*body == '+' || *body == '-')
body++;
- while (isalpha(*body))
+ while (g_ascii_isalpha(*body))
body++;
- while (isspace(*body))
+ while (g_ascii_isspace(*body))
body++;
}