On Mon, 2003-03-03 at 09:52, Rick Romero wrote:
> I wanted to mention that when using qmailadmin-1.12 and vpopmail-5.3.18,
> if I set the quota from qmailadmin to 100MB, the quota is set to
> 100483292.00  (I'm just guessing on the bytes, but you get the idea).
> 
> For some reason, I belive the .00 makes vdelivermail bounce email saying
> the user is over quota.  Using vsetuserquota to set the actual # of
> bytes works fine though.

Ok, so here's the code in vpopmail.c (right at the end):

char *format_maildirquota(const char *q) {
int     i;
int     per_user_limit;
static char    tempquota[500];

    /* translate the quota to a number, or leave it */
    i = strlen(q) - 1;
    tempquota[0] = '\0'; /* make sure tempquota is 0 length */
    if(strstr(q, ",") == NULL && q[i] != 'S') {
        per_user_limit = atol(q);
        for(i=0;q[i]!=0;++i) {
            if ( q[i] == 'k' || q[i] == 'K' ) {
                per_user_limit = per_user_limit * 1024;
                snprintf(tempquota, 500, "%dS", per_user_limit);
                break;
            }
            if ( q[i] == 'm' || q[i] == 'M' ) {
                per_user_limit = per_user_limit * 1048576;
                sprintf(tempquota, "%dS", per_user_limit);
                break;
            }
        }



Maybe this isn't the problem... but if per_user_int is initialized as an
int, should atol be atoi?  
Though, supposedly atol() should stop 'converting' at the period
anyways..  Maybe it's crashing?




> Rick
> 



Reply via email to