diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 33fcfbb..bcddb5e 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -1723,9 +1723,9 @@ function wp_get_archives( $args = '' ) {
 		$r['type'] = 'monthly';
 	}
 
-	if ( ! empty( $r['limit'] ) ) {
+	if ( isset( $r['limit'] ) ) {
 		$r['limit'] = absint( $r['limit'] );
-		$r['limit'] = ' LIMIT ' . $r['limit'];
+		$r['limit'] = $r['limit'] ? ' LIMIT ' . $r['limit'] : '';
 	}
 
 	$order = strtoupper( $r['order'] );
