gboolean g_vfs_afp_reply_read_pascal (GVfsAfpReply *reply, char **str) { guint8 strsize; if (!g_vfs_afp_reply_read_byte (reply, &strsize)) return FALSE; if (strsize > (reply->len - reply->pos)) { reply->pos--; return FALSE; } if (str) *str = g_strndup (reply->data + reply->pos, strsize); reply->pos += strsize; return TRUE; }
gboolean g_vfs_afp_reply_read_pascal (GVfsAfpReply *reply, char **str) { guint8 strsize; if (!g_vfs_afp_reply_read_byte (reply, &strsize)) return FALSE; if (strsize > (reply->len - reply->pos)) { reply->pos--; return FALSE; } if (str) { *str = g_convert (reply->data + reply->pos, strsize, "UTF-8", "MACINTOSH", NULL, NULL, NULL); } reply->pos += strsize; return TRUE; }